Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

annie::SimpleNeuron Class Reference

#include <SimpleNeuron.h>

Inheritance diagram for annie::SimpleNeuron:

annie::Neuron annie::RecurrentNeuron List of all members.

Public Methods

 SimpleNeuron (int label, bool hasBias=true)
virtual void setBias (real bias)
virtual bool hasBias ()
 Is the neuron allowed to have a bias? More...

virtual real getBias ()
 The bias of the neuron, 0.0 if it's not allowed to have a bias. More...

virtual void removeBias ()
 Sets bias to 0.0 and prevents the neuron from having a bias. More...

virtual void setDesiredOutput (real desired)
virtual void setActivationFunction (ActivationFunction f, ActivationFunction df)
virtual void connect (Neuron *from)
virtual void connect (Neuron *from, real weight)
virtual void calculateNewWeights (real learningRate, real momentum=0.0)
virtual void update ()
virtual std::string toString ()
 
See also:
Neuron::toString.
More...


virtual const char * getClassName ()
 Returns "SimpleNeuron". More...

virtual real getWeight (Neuron *from)

Protected Methods

virtual void _recacheOutput ()
 
See also:
Neuron::_recacheOutput.
More...


virtual void _recacheError ()
 
See also:
Neuron::_recacheError.
More...



Protected Attributes

bool _hasBias
 Is this neuron allowed to have a bias? More...

real _bias
 If allowed to have a bias then the bias, otherwise 0.0. More...

real _deltaBias
 The change in bias, calculated using the gradient descent rule. More...

ActivationFunction _dActivationFunction
 The derivative of the activation function, required for gradient descent training. More...


Detailed Description

A simple perceptron - i.e., it takes as input the weighted sum of the outputs of the neurons connected to it. Probably the first type of neuron you would come across in any introductory literature of neural networks.


Constructor & Destructor Documentation

annie::SimpleNeuron::SimpleNeuron int    label,
bool    hasBias = true
 

Creates a simple neuron with the given label.

Parameters:
label  The label to be given to the neuron
hasBias  true if the neuron is allowed to have a bias, false otherwise. Default is true
See also:
removeBias


Member Function Documentation

virtual void annie::SimpleNeuron::_recacheError   [protected, virtual]
 

See also:
Neuron::_recacheError.

Implements annie::Neuron.

virtual void annie::SimpleNeuron::_recacheOutput   [protected, virtual]
 

See also:
Neuron::_recacheOutput.

Implements annie::Neuron.

Reimplemented in annie::RecurrentNeuron.

virtual void annie::SimpleNeuron::calculateNewWeights real    learningRate,
real    momentum = 0.0
[virtual]
 

Calculates the adjustment to incoming weights based on the gradient descent rule (backpropagation). Doesn't actually update the weights, just sets the value.

See also:
update

virtual void annie::SimpleNeuron::connect Neuron   from,
real    weight
[virtual]
 

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.

Parameters:
from  The neuron whose output is to be taken as input
weight  The weight of the connection

virtual void annie::SimpleNeuron::connect Neuron   from [virtual]
 

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

Parameters:
from  The neuron whose output is to be taken is as input

virtual real annie::SimpleNeuron::getBias   [virtual]
 

The bias of the neuron, 0.0 if it's not allowed to have a bias.

virtual const char* annie::SimpleNeuron::getClassName   [virtual]
 

Returns "SimpleNeuron".

Implements annie::Neuron.

Reimplemented in annie::RecurrentNeuron.

virtual real annie::SimpleNeuron::getWeight Neuron   from [virtual]
 

Returns the weight of the link between the provided neuron and this neuron.

Parameters:
from  The neuron whose output is connected to this neuron's input
Returns:
The weight of the connection, 0.0 if no connection exists

Reimplemented from annie::Neuron.

virtual bool annie::SimpleNeuron::hasBias   [virtual]
 

Is the neuron allowed to have a bias?

virtual void annie::SimpleNeuron::removeBias   [virtual]
 

Sets bias to 0.0 and prevents the neuron from having a bias.

virtual void annie::SimpleNeuron::setActivationFunction ActivationFunction    f,
ActivationFunction    df
[virtual]
 

Sets the activation function and its derivative (required for error backpropagation)

Parameters:
f  The activation function to be used
df  The derivative of the activation function

virtual void annie::SimpleNeuron::setBias real    bias [virtual]
 

Sets the bias of the neuron.

Parameters:
bias  The bias to be given to the neuron
Exceptions:
Exception  if the neuron is not allowed to have a bias

virtual void annie::SimpleNeuron::setDesiredOutput real    desired [virtual]
 

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

Parameters:
desired  The desired output of this neuron
Exceptions:
Exception  if the neuron is not an output neuron

Reimplemented in annie::RecurrentNeuron.

virtual std::string annie::SimpleNeuron::toString   [virtual]
 

See also:
Neuron::toString.

Reimplemented from annie::Neuron.

virtual void annie::SimpleNeuron::update   [virtual]
 

Updates the weights of incoming connections according to the values calculated using the gradient descent rule.

See also:
calculateNewWeights

Reimplemented in annie::RecurrentNeuron.


Member Data Documentation

real annie::SimpleNeuron::_bias [protected]
 

If allowed to have a bias then the bias, otherwise 0.0.

ActivationFunction annie::SimpleNeuron::_dActivationFunction [protected]
 

The derivative of the activation function, required for gradient descent training.

real annie::SimpleNeuron::_deltaBias [protected]
 

The change in bias, calculated using the gradient descent rule.

bool annie::SimpleNeuron::_hasBias [protected]
 

Is this neuron allowed to have a bias?


The documentation for this class was generated from the following file:
Generated on Wed Apr 23 10:42:36 2003 for BioFilter by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002