#include <RecurrentNeuron.h>
Inheritance diagram for RecurrentNeuron:
Public Member Functions | |
RecurrentNeuron (int label, real bias, real activation=0.) | |
Creates a recurrent neuron. | |
void | setActivationFunction (ActivationFunction f) |
virtual void | update () |
Recompute output. | |
virtual void | invalidateOutputCache () |
Invalidates the output cache of this neuron. | |
virtual real | getOutput () const |
Returns the last output of the neuron. | |
virtual const char * | getClassName () const |
Returns "RecurrentNeuron". | |
virtual void | reset (real initialActivation) |
Resets the neuron to given state. | |
virtual void | calculateNewWeights (real learningRate) NONSENSE virtual void setDesiredOutput(real desired) NONSENSE protected |
Not sensible. | |
Public Attributes | |
real | _bias |
If allowed to have a bias then the bias, otherwise 0.0. |
These neurons have a concept of time. Thus, their output starts from an initial state and then as time progresses their output may change.
Recurrent networks allow cycles in the graph formed by connections between neurons, which are not allowed by simple multi-layer networks. For example, consider a network in which a recurrent neuron is connected to itself. Output now becomes time dependent. output(time=0) = an initial, fixed value. output(time=1) = weight_of_link * output(0) output(time=t) = weight_of_link * output(t-1) etc.
A recurrent neuron has all the features of a simple neuron and adds the concept of time, hence the RecurrentNeuron class is a sub-class of the SimpleNeuron class
major changes: 6/2004 OP: As it is no longer used in Hopfield, it was reworked (just a little bit) to fit into the more general RecurrentNetwork. Storing of time and initialState was removed to save time/space. Also, bias is on by default (set it to 0, if you don't want it)
op
|
Creates a recurrent neuron. The default initial value is 0, thus at time=0 the output of the neuron will be 0. To change use reset
|
|
Not sensible.
|
|
Returns "RecurrentNeuron".
Reimplemented from SimpleNeuron. |
|
Returns the last output of the neuron. At time 0 this will be the initial value which is set using reset(), and which is zero by default. Otherwise it will be the output computed before last step()
Reimplemented from Neuron. |
|
Invalidates the output cache of this neuron. Should be called on any structural change Structural changes such as changes to the input or output links and/or their weights should invalidate the cache of the neuron using this function. Causes the cache of all neurons who receive input from this neuron to be invalidated as well. Reimplemented from Neuron. |
|
Resets the neuron to given state.
|
|
|
|
Recompute output.
Reimplemented from AbstractNeuron. |
|
If allowed to have a bias then the bias, otherwise 0.0.
Reimplemented from AbstractNeuron. |