00001 #ifndef INPUTNEURON_H_ 00002 #define INPUTNEURON_H_ 00003 #include "GeneralNeuron.h" 00004 #include "FatalException.h" 00005 00006 namespace gplib 00007 { 00008 /** \addtogroup neuralnet Neural Network filtering */ 00009 /* @{ */ 00010 00011 //! The iput neuron class provides the bridge between the network input and the other neurons, 00012 //! a lot of base class functionality does not make sense here and throws an exception, should think of a better way 00013 class InputNeuron: public GeneralNeuron 00014 { 00015 private: 00016 //! A reference to a double that is used as input for the neural network 00017 double &In; 00018 //! There are no weights or bias, so we just return the input value as output 00019 virtual double CalcOutput() 00020 { 00021 return In; 00022 } 00023 public: 00024 virtual const std::vector<double> &GetOldDelta() 00025 { 00026 throw FatalException("Not implemented"); 00027 } 00028 virtual std::vector<double> &SetOldDelta() 00029 { 00030 throw FatalException("Not implemented"); 00031 } 00032 virtual double CalcDeriv(const double input) 00033 { 00034 return 1.0; 00035 } 00036 virtual double GetNet() 00037 { 00038 return In; 00039 } 00040 virtual double GetDelta() 00041 { 00042 return 0.0; 00043 } 00044 virtual void SetDelta(const double d) 00045 { 00046 } 00047 virtual void SetBias(const double b) 00048 { 00049 } 00050 virtual double GetBias() 00051 { 00052 return 0.0; 00053 } 00054 virtual const std::vector<double> &GetWeights() 00055 { 00056 throw FatalException("Not implemented"); 00057 } 00058 virtual std::vector<double> &SetWeights() 00059 { 00060 throw FatalException("Not implemented"); 00061 } 00062 virtual const GeneralLinearCombiner::tinvector &GetInput() 00063 { 00064 throw FatalException("Not implemented"); 00065 } 00066 InputNeuron(double &Infield) : 00067 In(Infield) 00068 { 00069 } 00070 virtual ~InputNeuron() 00071 { 00072 } 00073 }; 00074 /* @} */ 00075 } 00076 #endif /*INPUTNEURON_H_*/
1.5.8