LCFIVertex  0.7.2
SigmoidNeuron.h
1 #ifndef SIGMOIDNEURON_H
2 #define SIGMOIDNEURON_H
3 
4 #include "NeuralNetConfig.h"
5 #include "Neuron.h"
6 
7 #include <iostream>
8 #include <string>
9 
10 //namespace nnet added 15/08/06 by Mark Grimes (mark.grimes@bristol.ac.uk) for the LCFI vertex package
11 namespace nnet
12 {
13 
14 class NeuralNet;
15 
16 class NEURALNETDLL SigmoidNeuron :
17  public Neuron
18 {
19 public:
20  SigmoidNeuron(const int numberOfInputs,const double bias=-1.0,double response=1.0,const NeuralNet *parent=0);
21  double response() const {return _response;}
22  void setResponse(double response) {_response = response;}
23  void destroy() const;
24  Neuron *clone(const NeuralNet *parentNetwork) const;
25  void outputRange(double &outputmin,double &outputmax) const
26  { outputmin = 0.0; outputmax = 1.0;}
27 
28 
29 protected:
30  ~SigmoidNeuron(void);
31  double thresholdFunction(const double activation) const;
32  double derivative(const double x) const;
33  void serialiseExtra(std::ostream &os) const;
34  std::string neuronType() const {return "SigmoidNeuron";}
35 
36 private:
37  SigmoidNeuron(const SigmoidNeuron &other); // Declared but not defined
38  double _response;
39 };
40 
41 }//namespace nnet
42 
43 #endif