GPLIB++
InputNeuron.h
Go to the documentation of this file.
1 #ifndef INPUTNEURON_H_
2 #define INPUTNEURON_H_
3 #include "GeneralNeuron.h"
4 #include "FatalException.h"
5 
6 namespace gplib
7  {
8  /** \addtogroup neuralnet Neural Network filtering */
9  /* @{ */
10 
11  //! The iput neuron class provides the bridge between the network input and the other neurons,
12  //! a lot of base class functionality does not make sense here and throws an exception, should think of a better way
13  class InputNeuron: public GeneralNeuron
14  {
15  private:
16  //! A reference to a double that is used as input for the neural network
17  double &In;
18  //! There are no weights or bias, so we just return the input value as output
19  virtual double CalcOutput()
20  {
21  return In;
22  }
23  public:
24  virtual const std::vector<double> &GetOldDelta()
25  {
26  throw FatalException("Not implemented");
27  }
28  virtual std::vector<double> &SetOldDelta()
29  {
30  throw FatalException("Not implemented");
31  }
32  virtual double CalcDeriv(const double input)
33  {
34  return 1.0;
35  }
36  virtual double GetNet()
37  {
38  return In;
39  }
40  virtual double GetDelta()
41  {
42  return 0.0;
43  }
44  virtual void SetDelta(const double d)
45  {
46  }
47  virtual void SetBias(const double b)
48  {
49  }
50  virtual double GetBias()
51  {
52  return 0.0;
53  }
54  virtual const std::vector<double> &GetWeights()
55  {
56  throw FatalException("Not implemented");
57  }
58  virtual std::vector<double> &SetWeights()
59  {
60  throw FatalException("Not implemented");
61  }
63  {
64  throw FatalException("Not implemented");
65  }
66  InputNeuron(double &Infield) :
67  In(Infield)
68  {
69  }
70  virtual ~InputNeuron()
71  {
72  }
73  };
74  /* @} */
75  }
76 #endif /*INPUTNEURON_H_*/
virtual const std::vector< double > & GetWeights()
Access function for the weights.
Definition: InputNeuron.h:54
virtual double GetNet()
Get the net output before application of the activation function.
Definition: InputNeuron.h:36
virtual void SetDelta(const double d)
Set delta.
Definition: InputNeuron.h:44
virtual std::vector< double > & SetWeights()
Definition: InputNeuron.h:58
virtual const GeneralLinearCombiner::tinvector & GetInput()
Get the pointers to the input neurons.
Definition: InputNeuron.h:62
The base class for all neurons in a neural network.
Definition: GeneralNeuron.h:14
InputNeuron(double &Infield)
Definition: InputNeuron.h:66
virtual const std::vector< double > & GetOldDelta()
Vector valued delta for the momentum adaptation scheme.
Definition: InputNeuron.h:24
virtual double CalcDeriv(const double input)
Calculate the derivative of the activation function, at point input.
Definition: InputNeuron.h:32
virtual std::vector< double > & SetOldDelta()
Definition: InputNeuron.h:28
virtual double GetBias()
Get the bias.
Definition: InputNeuron.h:50
virtual double GetDelta()
Get delta for the weight correction formula.
Definition: InputNeuron.h:40
virtual void SetBias(const double b)
Set the bias.
Definition: InputNeuron.h:47
std::vector< boost::shared_ptr< GeneralNeuron > > tinvector
The basic exception class for all errors that arise in gplib.
virtual ~InputNeuron()
Definition: InputNeuron.h:70