///////////////////////////////////////////////////////////////////////////// // // class RecurrentNeuron // // this is an implementation of one neuron of a Recurrent Neural Network // this neuron can have n input values, m values in it's memory and // one output value // (see NeuralNet documentations for more information) // // header file // // Copyright (c) 2005 Georg Holzmann // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // ///////////////////////////////////////////////////////////////////////////// #ifndef _INCLUDE_RECURRENT_NEURON_NET__ #define _INCLUDE_RECURRENT_NEURON_NET__ #include #include #include "Neuron.h" namespace TheBrain { //------------------------------------------------------ /* class of one neuron */ class RecurrentNeuron : public Neuron { protected: /* this determines how much output values the net * can remeber * these values are fed back as new input */ int memory_; /* the weight matrix for the recurrent * values (size: memory_) */ float *LW_; public: /* Constructor */ RecurrentNeuron(int inputs, int memory); /* Destructor */ virtual ~RecurrentNeuron(); //----------------------------------------------------- /* some more get/set methods */ virtual int getMemory() const { return memory_; } virtual float *getLW() const { return LW_; } virtual float getLW(int index) const { return LW_[index]; } virtual void setLW(const float *LW) { for(int i=0; i