#include <AbstractNeuron.h>
Inheritance diagram for AbstractNeuron:
Public Member Functions | |
AbstractNeuron (int label, bool hasBias=true) | |
Creates a simple neuron with the given label. | |
virtual void | setBias (real bias) |
Sets the bias of the neuron. | |
virtual bool | hasBias () const |
Is the neuron allowed to have a bias? | |
virtual real | getBias () const |
The bias of the neuron, 0.0 if it's not allowed to have a bias. | |
virtual void | removeBias () |
Sets bias to 0.0 and prevents the neuron from having a bias. | |
virtual void | setDesiredOutput (real desired)=0 |
Sets the desired output of the neuron. | |
virtual void | connect (Neuron *from) |
Connects the given neuron to this one, i.e., the output of the supplied neuron will be given as input to this neuron. | |
void | connect (Neuron &from) |
void | connect (Neuron &from, real w) |
void | connectFrom (Neuron *from) |
TODO: rename the above... | |
virtual void | connect (Neuron *from, real weight) |
Connects the given neuron to this one, i.e., the output of the supplied neuron will be given as input to this neuron. | |
virtual void | calculateNewWeights (real learningRate, real momentum) |
Calculates the adjustment to incoming weights based on the gradient descent rule (backpropagation). | |
virtual void | update () |
Updates the weights of incoming connections according to the values calculated using the gradient descent rule. | |
virtual const char * | getClassName () const |
Returns "AbstractNeuron". | |
virtual real | getWeight (Neuron *from) const |
Returns the weight of the link between the provided neuron and this neuron. | |
void | randomizeWeights () |
virtual | operator std::string () const |
Neuron::string(). | |
Static Public Member Functions | |
real | getRandomWeight () |
Protected Member Functions | |
virtual void | _recacheOutput () const=0 |
Neuron::_recacheOutput. | |
virtual void | _recacheError () const=0 |
Neuron::_recacheError. | |
Protected Attributes | |
bool | _hasBias |
Is this neuron allowed to have a bias? | |
real | _bias |
If allowed to have a bias then the bias, otherwise 0.0. | |
real | _deltaBias |
The change in bias, calculated using the gradient descent rule. | |
Static Protected Attributes | |
const real | INIT_WEIGHT_MAX |
Has everything except activation function, which is defined in offsprings.
Note: rather than adding more virtual functions for activation function and derivation, we make virtual recaching functions. This should be more efficient in the performance-critical parts.
|
Creates a simple neuron with the given label.
|
|
Implements Neuron. Implemented in SimpleNeuron. |
|
Implements Neuron. Implemented in KohonenNeuron, and SimpleNeuron. |
|
Calculates the adjustment to incoming weights based on the gradient descent rule (backpropagation). Doesn't actually update the weights, just sets the value.
|
|
Connects the given neuron to this one, i.e., the output of the supplied neuron will be given as input to this neuron. The weight of the link will be the one supplied.
|
|
|
Here is the call graph for this function:
|
|
Here is the call graph for this function:
|
Connects the given neuron to this one, i.e., the output of the supplied neuron will be given as input to this neuron. A random weight is provided to the link
|
|
TODO: rename the above...
|
Here is the call graph for this function:
|
The bias of the neuron, 0.0 if it's not allowed to have a bias.
|
|
Returns "AbstractNeuron".
Implements Neuron. Reimplemented in RecurrentNeuron, and SimpleNeuron. |
|
|
|
Returns the weight of the link between the provided neuron and this neuron.
Reimplemented from Neuron. |
|
Is the neuron allowed to have a bias?
|
|
Neuron::string().
Reimplemented from Neuron. |
|
Reimplemented in KohonenNeuron. |
|
Sets bias to 0.0 and prevents the neuron from having a bias.
|
|
Sets the bias of the neuron.
|
|
Sets the desired output of the neuron. Should be called only for output neurons, i.e., those whose output is not connected to anyone else. Setting the desired output at these neurons will form the basis of error backpropagation
Implemented in ParametrizedNeuron, and SimpleNeuron. |
|
Updates the weights of incoming connections according to the values calculated using the gradient descent rule.
Reimplemented in RecurrentNeuron. |
|
If allowed to have a bias then the bias, otherwise 0.0.
Reimplemented in RecurrentNeuron. |
|
The change in bias, calculated using the gradient descent rule.
|
|
Is this neuron allowed to have a bias?
|
|
|