Evonet is the neural network taken from the EvoRobot. More...

Inheritance diagram for Evonet:

Signals

void evonetUpdated ()
 emitted everytime the Evonet has been updated

Public Member Functions

 Evonet ()
 The class constructor.
float backPropStep (QVector< float > tInput, double rate)
 Computes the neuron deltas for the Backpropagation algorithm.
float backPropStep2 (QVector< float > tInput, double rate)
 Computes the neuron deltas for the Backpropagation algorithm but does not update the weights.
void calculateBackPropagationError (QVector< float > tInput)
 Computes the Backpropagation error (the backpropagation algorithm is not applied to the ANN)
float computeMeanSquaredError (QVector< float > trainingSet, QVector< float > desiredOutput)
 Update the network and compute and return the mean squared error.
void computeParameters ()
 Compute the required number of free parameters on the basis of: (i) the property of the neurons (stored in the vectors neurontype[], neuronbias[], neurongain[]) (ii) the connection blocks (stored in the matrix net_block[b][0])
void configure (ConfigurationParameters &params, QString prefix)
 Configures the object using a ConfigurationParameters object.
void copyPheParameters (int *pheGene)
 transorm floating point parameters normalized in the range [-wrange,range] into integer parameters in the range [0,255]
void create_net_block (int inputNeuronType, int hiddenNeuronType, int outputNeuronType, bool recurrentHiddens, bool inputOutputConnections, bool recurrentOutputs, bool biasOnHidden, bool biasOnOutput)
 Create the block structure that describe the architecture of the network (unless this structure is created through the graphic interface and loaded froa a .net or .phe file) Update blocks describe group of neurons to be updated Connections blocks describe the group of neurons receiving the connections and the group sending the connections Gain blocks describe a group of neurons that share the same gain of that have a gain regulated by a third neuron This functions also set whether neurons have biases, timeconstant, and gains the neuron update function (e.g.
void endTraining ()
 de-allocate variables create for training
int exportWeightsToMATLABFile (char *path)
int extractWeightsFromNet (Eigen::VectorXf &w)
 Extract the connection weights and biases from the free parameters vector into a matrix to be used by the Levenberg Marquardt Algoririthm.
int freeParameters ()
 return number of defined free parameters
float getBackPropError ()
 Returns the Backpropagation algorithm error.
float getBrange ()
 return the value of brange
float getFreeParameter (int i)
 return the value of the ith parameter (normalized in the range [-wrange, wrange]
float getGrange ()
 return the value of grange
float getHidden (int h)
 return the value of a hidden neuron (-999 if the specified id is out of range)
float getInput (int in)
 return the value of a sensory neuron
void getMutations (float *mut)
 set the mutation vector of the genetic algorithm that determine how parameters are mutated
const QString & getNetworkName () const
 Returns the name of this neural network.
float getNeuron (int in)
 return the activation of a neuron
int getNoHiddens ()
 return the number of internal neurons
int getNoInputs ()
 return the number of sensory neurons
int getNoNeurons ()
 return the total number of neurons
int getNoOutputs ()
 return the number of motor neurons
float * getOldestStoredActivations ()
 Returns the oldest stored activation vector and removes it.
float getOutput (int out)
 return the value of a motor neuron (-1 if the specified id is out of range)
int getParamBias (int nbias)
 return the value of a bias
float getTeachingInputEntry (int id)
 Returns the value of the teaching input element in id position.
ParameterSettableUIgetUIManager ()
 Return a new instance of the EvonetUI.
float getWeight (int to, int from)
 Return the weight that depart from neuron "from" and reach neuron "to".
float getWrange ()
 return the value of wrange (which also determine the range in which all parameters are normalized)
void hardwire ()
 Experiment specific function that set the weights for a reflex and set the weights that should not be trained to 0.0.
int importWeightsFromMATLABFile (char *path)
int importWeightsFromVector (Eigen::VectorXf &w)
 Copy back the weights and biases trained through the Levenberg Marquardt Algorithm into the free parameters vector.
void initBackPropFreep ()
 Initializes backpropfreep for applying backPropStep2 algorithm.
void initWeightsInRange (float min, float max)
 Initializes weights and biases randomly.
void initWeightsInRange (float minBias, float maxBias, float minWeight, float maxWeight)
 Initializes weights and biases randomly.
void initWeightsNguyenWidrow (float min, float max)
 Initializes weights and biases according to the Nguyen-Widrow initialization algorithm.
void injectHidden (int nh, float val)
 set the actiovation state of a hidden neuron
bool inTraining ()
int load_net_blocks (const char *filename, int mode)
 Load the description of the neural architecture from .net of .phe file (see the create_net_block method description)
float logistic (float f)
 logistic function
bool pheFileLoaded ()
 check whether a .phe file (with parameters description) has been loaded
void prepareForTraining (QVector< float > &err_w)
 Initialize variables required by back-propagation training mconnections: number of weights and biases subject to training outputsToTrain: outputsToTrain[i]==1 iff the i-th output is subject to training n_outputsToTrain: number of output neurons to train trainingHiddenBlock: a matrix of noutputs value for each neuron.
void printAct ()
 Print neurons activation state.
void printBlocks ()
 display the architecture structure
void printIO ()
 Print the activation state of sensory, internal, and motor neurons.
void printWeights ()
 Print all free parameters.
void readNewPheLine (QStringList, float *, float *)
 Assign to a free parameter and to the free parameter mutation rate the value extracted from a string loaded from a file .phe file.
void readOldPheLine (QStringList, float *, float *)
 Assign to a free parameter and to the free parameter mutation rate the value extracted from a string loaded from a file .phe file This function is used instead of the readNewPheLine() method to parse .phe files that contain a single QstringList element.
void resetNet ()
 reset to 0.0 the activation state of all neurons
void save (ConfigurationParameters &params, QString prefix)
 Saves the actual status of parameters into the ConfigurationParameters object passed.
void save_net_blocks (const char *filename, int mode)
 Save the description of the neural architecture into a .net of .phe file (see the create_net_block method description)
int setInput (int inp, float value)
 set the value of a sensory neuron
void setNeckReflex ()
 Experiment specific function that set certain weights so to provide a given reflex behavior.
void setNetworkName (const QString &name)
 Sets the name of this neural network.
void setParameters (const int *dt)
 set the free parameters on the basis of a genotype string
void setRanges (double weight, double bias, double gain)
 set the range of connection weights, biases, and gains
void setWeight (int to, int from, float w)
 Set the weight that depart from neuron "from" and reach neuron "to".
bool showTeachingInput ()
 Checks whether the teaching input has to be shown.
float tansig (float f)
 Hyperbolic tangent sigmoid transfer function.
float trainLevembergMarquardt (QVector< float > trainingSet, QVector< float > desiredOutput, float maxError)
 Train the network through the Levemberg Marquardt gradient descent algorithm.
float trainLevembergMarquardtThroughTime (QVector< float > trainingSet, QVector< float > desiredOutput, int time, float maxError)
 Train the network through the Levemberg Marquardt through time gradient descent algorithm.
int updateCounts ()
 return the number of updates (step) done
void updateNet ()
 Update the state of the internal and motor neurons on the basis of: (i) the property of the neurons (stored in the vectors neurontype[], neuronbias[], neurongain[]) (ii) the update, connection, and gain blocks (stored in the matrix net_block[b][0]) (iii) the value of the free parameters.
void updateWeightsAfterBackProp ()
 Updates the weights of the ANN.
- Public Member Functions inherited from ParameterSettableWithConfigureFunction
void addObserver (RuntimeParameterObserver *obs)
getRuntimeParameter (QString paramName)
 ParameterSettable ()
virtual void postConfigureInitialization ()
void removeObserver (RuntimeParameterObserver *obs)
void setRuntimeParameter (QString paramName, T newvalue)
QString typeName () const

Static Public Member Functions

static void describe (QString type)
 Add to Factory::typeDescriptions() the descriptions of all parameters and subgroups.
- Static Public Member Functions inherited from ParameterSettableWithConfigureFunction
static QString fullParameterDescriptionPath (QString type, QString param)
static QString fullSubgroupDescriptionPath (QString type, QString sub)

Public Attributes

int maxIterations
 Maximum number of training iteration.
QColor neurondcolor [MAXN]
 the color used to display the actiovation state of each neuron in the neuron monitor widget
int neurondisplay [MAXN]
 the vectors that specify for each neuron whether it should be displayed or not by the neuron monitor widget
char neuronl [MAXN][10]
 the labels of the neurons displayed by the graphic widget
bool neuronlesion [MAXN]
 a vector that speficy lesioned and unlesioned neurons
int neuronlesions
 Whether one or more neurons have been lesioned.
float neuronlesionVal [MAXN]
 the value to be assigned to the state of lesioned neurons
double neuronrange [MAXN][2]
 the matrix that contain the variation range of neurons used by the neuron monitor graphic widget
int nselected
 Number of parameters selected through the graphic interface Enable the user to modify the parameters manually through the graphic widget.
float ** selectedp
 pointer to the list pointer-to-parameters selected through the graphic interface Enable the user to modify the parameters manually through the graphic widget
- Public Attributes inherited from ParameterSettableWithConfigureFunction
 AllowMultiple
 Default
 IsList
 IsMandatory
- Public Attributes inherited from ParameterSettable
 AllowMultiple
 Default
 IsList
 IsMandatory

Static Public Attributes

static const float DEFAULT_VALUE = -99.0f
 DEFAULT_VALUE is used for do not assign values to mut and parameters.
static const int MAXN = 1000
 Maximum number of neurons for a neural network of this type.
static const int MAXSTOREDACTIVATIONS = 100
 The maximum number of stored activation vectors.
- Static Public Attributes inherited from ParameterSettableWithConfigureFunction
static const double Infinity
static const int MaxInteger
static const int MinInteger
- Static Public Attributes inherited from ParameterSettable
static const double Infinity
static const int MaxInteger
static const int MinInteger

Friends

class NetworkDialog
class RendNetwork

Additional Inherited Members

- Public Types inherited from ParameterSettableWithConfigureFunction
enum  Property
- Protected Member Functions inherited from ParameterSettableWithConfigureFunction
void notifyChangesToParam (QString paramName)
- Static Protected Member Functions inherited from ParameterSettableWithConfigureFunction
static Descriptor addTypeDescription (QString type, QString shortHelp, QString longHelp=QString(""))
static void setGraphicalEditor (QString type)

Detailed Description

Evonet is the neural network taken from the EvoRobot.

Simple class to load a evorobot.net configuration file

Definition at line 100 of file evonet.h.

Constructor & Destructor Documentation

Member Function Documentation

float backPropStep ( QVector< float >  tInput,
double  rate 
)

Computes the neuron deltas for the Backpropagation algorithm.

Parameters
tInputthe input vector
ratethe delta rate
Returns
the Backpropagation error

Definition at line 1916 of file evonet.cpp.

References DataUploader< DataType_t >::getDownloader(), and Evonet::MAXN.

float backPropStep2 ( QVector< float >  tInput,
double  rate 
)

Computes the neuron deltas for the Backpropagation algorithm but does not update the weights.

Parameters
tInputthe input vector
ratethe delta rate
Returns
the Backpropagation error

Definition at line 2030 of file evonet.cpp.

References DataUploader< DataType_t >::getDownloader(), and Evonet::MAXN.

void calculateBackPropagationError ( QVector< float >  tInput)

Computes the Backpropagation error (the backpropagation algorithm is not applied to the ANN)

Parameters
tInputthe input vector

Definition at line 2145 of file evonet.cpp.

float computeMeanSquaredError ( QVector< float >  trainingSet,
QVector< float >  desiredOutput 
)

Update the network and compute and return the mean squared error.

Parameters
trainingSetthe input vector
desiredOutputthe teaching vector

Definition at line 1470 of file evonet.cpp.

References Evonet::setInput(), and Evonet::updateNet().

Referenced by Evonet::trainLevembergMarquardt(), and Evonet::trainLevembergMarquardtThroughTime().

void computeParameters ( )

Compute the required number of free parameters on the basis of: (i) the property of the neurons (stored in the vectors neurontype[], neuronbias[], neurongain[]) (ii) the connection blocks (stored in the matrix net_block[b][0])

Definition at line 695 of file evonet.cpp.

References Evonet::MAXN, and Logger::warning().

Referenced by Evonet::configure(), Evonet::create_net_block(), and Evonet::save_net_blocks().

void configure ( ConfigurationParameters params,
QString  prefix 
)
virtual

Configures the object using a ConfigurationParameters object.

Parameters
paramsthe configuration parameters object with parameters to use
prefixthe prefix to use to access the object configuration parameters. This is guaranteed to end with the separator character when called by the factory, so you don't need to add one

Implements ParameterSettableWithConfigureFunction.

Definition at line 105 of file evonet.cpp.

References Evonet::computeParameters(), Evonet::create_net_block(), Evonet::DEFAULT_VALUE, Logger::error(), ConfigurationHelper::getBool(), ConfigurationHelper::getDouble(), ConfigurationHelper::getInt(), ConfigurationHelper::getString(), Evonet::load_net_blocks(), Evonet::MAXN, Evonet::neurondcolor, Evonet::neuronl, Evonet::neuronrange, Evonet::printBlocks(), Evonet::resetNet(), and ConfigurationHelper::throwUserConfigError().

void copyPheParameters ( int *  pheGene)

transorm floating point parameters normalized in the range [-wrange,range] into integer parameters in the range [0,255]

Parameters
pheGenethe vector of integers to be filled with the current parameters

Definition at line 989 of file evonet.cpp.

References Evonet::DEFAULT_VALUE, and Evonet::freeParameters().

Referenced by TestRandom::buildRandomDNA(), and Evoga::getPheParametersAndMutationsFromEvonet().

void create_net_block ( int  inputNeuronType,
int  hiddenNeuronType,
int  outputNeuronType,
bool  recurrentHiddens,
bool  inputOutputConnections,
bool  recurrentOutputs,
bool  biasOnHidden,
bool  biasOnOutput 
)

Create the block structure that describe the architecture of the network (unless this structure is created through the graphic interface and loaded froa a .net or .phe file) Update blocks describe group of neurons to be updated Connections blocks describe the group of neurons receiving the connections and the group sending the connections Gain blocks describe a group of neurons that share the same gain of that have a gain regulated by a third neuron This functions also set whether neurons have biases, timeconstant, and gains the neuron update function (e.g.

logistic, leaky, binary) and the x,y positions in which the neurons are visualized in the graphic widgets

Definition at line 266 of file evonet.cpp.

References Evonet::computeParameters(), and Evonet::neurondisplay.

Referenced by Evonet::configure().

void endTraining ( )

de-allocate variables create for training

Definition at line 1892 of file evonet.cpp.

void evonetUpdated ( )
signal

emitted everytime the Evonet has been updated

Note
connect this signal to all necessary slots for updating the graphics stuff

Referenced by Evonet::setParameters(), and Evonet::updateNet().

int extractWeightsFromNet ( Eigen::VectorXf &  w)

Extract the connection weights and biases from the free parameters vector into a matrix to be used by the Levenberg Marquardt Algoririthm.

Definition at line 1514 of file evonet.cpp.

Referenced by Evonet::trainLevembergMarquardt(), and Evonet::trainLevembergMarquardtThroughTime().

float getBackPropError ( )

Returns the Backpropagation algorithm error.

Returns
the backpropagation error

Definition at line 1911 of file evonet.cpp.

float getBrange ( )

return the value of brange

Definition at line 1036 of file evonet.cpp.

float getFreeParameter ( int  i)

return the value of the ith parameter (normalized in the range [-wrange, wrange]

Definition at line 956 of file evonet.cpp.

Referenced by Evoga::updateGenomeFromEvonet().

float getGrange ( )

return the value of grange

Definition at line 1041 of file evonet.cpp.

float getHidden ( int  h)

return the value of a hidden neuron (-999 if the specified id is out of range)

Parameters
hthe id number of the motor neuron

Definition at line 942 of file evonet.cpp.

float getInput ( int  in)

return the value of a sensory neuron

Parameters
inthe id number of the motor neuron

Definition at line 914 of file evonet.cpp.

Referenced by EvonetIterator::getInput().

void getMutations ( float *  mut)

set the mutation vector of the genetic algorithm that determine how parameters are mutated

Parameters
mutthe pointer to the evonet mutation vector loaded from a.phe file

Definition at line 981 of file evonet.cpp.

References Evonet::freeParameters().

Referenced by Evoga::getPheParametersAndMutationsFromEvonet().

const QString & getNetworkName ( ) const

Returns the name of this neural network.

Returns
the name of this neural network

Definition at line 100 of file evonet.cpp.

float getNeuron ( int  in)

return the activation of a neuron

Parameters
inthe id number of the neuron

Definition at line 919 of file evonet.cpp.

int getNoHiddens ( )

return the number of internal neurons

Definition at line 1070 of file evonet.cpp.

Referenced by EvonetIterator::setGraphicProperties().

int getNoInputs ( )

return the number of sensory neurons

Definition at line 1065 of file evonet.cpp.

Referenced by EvonetIterator::setGraphicProperties().

int getNoNeurons ( )

return the total number of neurons

Definition at line 1080 of file evonet.cpp.

int getNoOutputs ( )

return the number of motor neurons

Definition at line 1075 of file evonet.cpp.

float * getOldestStoredActivations ( )

Returns the oldest stored activation vector and removes it.

This returns the oldest activation vector and deletes it (memory is not freed, simply an internal index is incremented), so that subsequent calls will progressively return newer activation vectors. Returns NULL when no activation vector is stored

Returns
the oldest stored activation or NULL if no stored activation vector is present

Definition at line 1092 of file evonet.cpp.

References Evonet::MAXSTOREDACTIVATIONS.

float getOutput ( int  out)

return the value of a motor neuron (-1 if the specified id is out of range)

Parameters
outthe id number of the motor neuron

Definition at line 906 of file evonet.cpp.

Referenced by EvonetIterator::getOutput().

int getParamBias ( int  nbias)

return the value of a bias

Parameters
hthe id number of the neuron

Definition at line 1022 of file evonet.cpp.

float getTeachingInputEntry ( int  id)

Returns the value of the teaching input element in id position.

Parameters
idthe index of the teaching input desired value
Returns
the value of the teaching input element

Definition at line 1906 of file evonet.cpp.

ParameterSettableUI * getUIManager ( )
virtual

Return a new instance of the EvonetUI.

Reimplemented from ParameterSettableWithConfigureFunction.

Definition at line 262 of file evonet.cpp.

float getWeight ( int  to,
int  from 
)

Return the weight that depart from neuron "from" and reach neuron "to".

Definition at line 1762 of file evonet.cpp.

References Evonet::freeParameters().

Referenced by Evonet::initWeightsNguyenWidrow(), Evonet::trainLevembergMarquardt(), and Evonet::trainLevembergMarquardtThroughTime().

float getWrange ( )

return the value of wrange (which also determine the range in which all parameters are normalized)

Definition at line 1031 of file evonet.cpp.

Referenced by Evoga::updateGenomeFromEvonet().

void hardwire ( )

Experiment specific function that set the weights for a reflex and set the weights that should not be trained to 0.0.

Definition at line 1224 of file evonet.cpp.

int importWeightsFromVector ( Eigen::VectorXf &  w)

Copy back the weights and biases trained through the Levenberg Marquardt Algorithm into the free parameters vector.

Definition at line 1643 of file evonet.cpp.

Referenced by Evonet::trainLevembergMarquardt(), and Evonet::trainLevembergMarquardtThroughTime().

void initBackPropFreep ( )

Initializes backpropfreep for applying backPropStep2 algorithm.

Definition at line 2162 of file evonet.cpp.

void initWeightsInRange ( float  min,
float  max 
)

Initializes weights and biases randomly.

Parameters
minthe minimum value of the weights
maxthe maximum value of the weights

Definition at line 1116 of file evonet.cpp.

References Evonet::freeParameters(), and farsa::min().

Referenced by Evonet::initWeightsNguyenWidrow().

void initWeightsInRange ( float  minBias,
float  maxBias,
float  minWeight,
float  maxWeight 
)

Initializes weights and biases randomly.

Here you can specify different ranges for biases and weights

 \param minBias the minimum value of the biases
 \param maxBias the maximum value of the biases
 \param minWeight the minimum value of the weights
 \param maxWeight the maximum value of the weights

Definition at line 1142 of file evonet.cpp.

References Evonet::freeParameters().

void initWeightsNguyenWidrow ( float  min,
float  max 
)

Initializes weights and biases according to the Nguyen-Widrow initialization algorithm.

Parameters
minthe minimum value of the weights
maxthe maximum value of the weights

Definition at line 1170 of file evonet.cpp.

References Evonet::getWeight(), Evonet::initWeightsInRange(), and Evonet::setWeight().

void injectHidden ( int  nh,
float  val 
)

set the actiovation state of a hidden neuron

Parameters
nhthe id number of the hidden
valthe activation value to be set

Definition at line 935 of file evonet.cpp.

int load_net_blocks ( const char *  filename,
int  mode 
)

Load the description of the neural architecture from .net of .phe file (see the create_net_block method description)

Parameters
filenamethe filename in which the description is contained
mode0=load only the architecture (.net file) 1=load also the value of the parameters (.phe file)

Definition at line 433 of file evonet.cpp.

References Logger::error(), Logger::info(), Evonet::MAXN, Evonet::neurondisplay, Evonet::readNewPheLine(), Evonet::readOldPheLine(), and Logger::warning().

Referenced by Evonet::configure().

float logistic ( float  f)

logistic function

Parameters
fthe input value of the function

Definition at line 682 of file evonet.cpp.

Referenced by Evonet::updateNet().

bool pheFileLoaded ( )

check whether a .phe file (with parameters description) has been loaded

Definition at line 961 of file evonet.cpp.

Referenced by Evoga::getPheParametersAndMutationsFromEvonet().

void prepareForTraining ( QVector< float > &  err_w)

Initialize variables required by back-propagation training mconnections: number of weights and biases subject to training outputsToTrain: outputsToTrain[i]==1 iff the i-th output is subject to training n_outputsToTrain: number of output neurons to train trainingHiddenBlock: a matrix of noutputs value for each neuron.

Parameters
err_w???

Definition at line 1814 of file evonet.cpp.

void printAct ( )

Print neurons activation state.

Definition at line 1461 of file evonet.cpp.

void printBlocks ( )

display the architecture structure

Definition at line 1047 of file evonet.cpp.

References Logger::info().

Referenced by Evonet::configure().

void printIO ( )

Print the activation state of sensory, internal, and motor neurons.

Definition at line 1001 of file evonet.cpp.

References Logger::info().

void printWeights ( )

Print all free parameters.

Definition at line 1108 of file evonet.cpp.

References Evonet::freeParameters().

void readNewPheLine ( QStringList  line,
float *  par,
float *  mut 
)

Assign to a free parameter and to the free parameter mutation rate the value extracted from a string loaded from a file .phe file.

Parameters
QStringListthe string from which the parameter is extracted, the first element contain the value or an "*" which means that the value of the parameter is initialized randomly the second element contain a mutation rate or "*" which means that the parameter has the default mutation rate
float*the pointer to the free parameter
float*the pointer to the mutation rate of the free parameter

Definition at line 539 of file evonet.cpp.

References Evonet::DEFAULT_VALUE.

Referenced by Evonet::load_net_blocks().

void readOldPheLine ( QStringList  line,
float *  par,
float *  mut 
)

Assign to a free parameter and to the free parameter mutation rate the value extracted from a string loaded from a file .phe file This function is used instead of the readNewPheLine() method to parse .phe files that contain a single QstringList element.

Parameters
QStringListthe string from which the parameter is extracted, the first element contain the value or an "*" which means that the value of the parameter is initialized randomly since the second element is missing, the parameter is considered as fixed (i.e. the mutation rate of the parameter is set to 0.0)
float*the pointer to the free parameter
float*the pointer to the mutation rate of the free parameter

Definition at line 530 of file evonet.cpp.

References Evonet::DEFAULT_VALUE.

Referenced by Evonet::load_net_blocks().

void resetNet ( )

reset to 0.0 the activation state of all neurons

Definition at line 924 of file evonet.cpp.

References Evonet::MAXN.

Referenced by Evonet::configure().

void save ( ConfigurationParameters params,
QString  prefix 
)
virtual

Saves the actual status of parameters into the ConfigurationParameters object passed.

Parameters
paramsthe configuration parameters object on which save actual parameters
prefixthe prefix to use to access the object configuration parameters.

Implements ParameterSettableWithConfigureFunction.

Definition at line 228 of file evonet.cpp.

References ConfigurationParameters::createParameter(), and ConfigurationParameters::startObjectParameters().

void save_net_blocks ( const char *  filename,
int  mode 
)

Save the description of the neural architecture into a .net of .phe file (see the create_net_block method description)

Parameters
filenamethe filename in which the description is contained
mode0=save only the architecture (.net file) 1=save also the value of the parameters (.phe file)

Definition at line 576 of file evonet.cpp.

References Evonet::computeParameters(), Evonet::DEFAULT_VALUE, Logger::error(), Evonet::freeParameters(), Logger::info(), Evonet::neurondisplay, and Evonet::neuronl.

int setInput ( int  inp,
float  value 
)

set the value of a sensory neuron

Parameters
inpthe id number of the sensory neuron
valuethe value to be set

Definition at line 897 of file evonet.cpp.

Referenced by Evonet::computeMeanSquaredError(), EvonetIterator::setInput(), Evonet::trainLevembergMarquardt(), and Evonet::trainLevembergMarquardtThroughTime().

void setNeckReflex ( )

Experiment specific function that set certain weights so to provide a given reflex behavior.

Definition at line 2972 of file evonet.cpp.

void setNetworkName ( const QString &  name)

Sets the name of this neural network.

This is just stored and not used anywhere in this class.

Parameters
namethe name of the network

Definition at line 95 of file evonet.cpp.

void setParameters ( const int *  dt)

set the free parameters on the basis of a genotype string

Parameters
dfthe pointer to the vector of genotype integers set in the range [0, 255]

Definition at line 969 of file evonet.cpp.

References Evonet::evonetUpdated(), and Evonet::freeParameters().

void setRanges ( double  weight,
double  bias,
double  gain 
)

set the range of connection weights, biases, and gains

Parameters
weightthe range of weights
biasthe range of biases
gainthe range of gains

Definition at line 1085 of file evonet.cpp.

void setWeight ( int  to,
int  from,
float  w 
)

Set the weight that depart from neuron "from" and reach neuron "to".

Definition at line 1787 of file evonet.cpp.

Referenced by Evonet::initWeightsNguyenWidrow().

bool showTeachingInput ( )

Checks whether the teaching input has to be shown.

Returns
TRUE if the teaching input must be shown, FALSE otherwise

Definition at line 1900 of file evonet.cpp.

float tansig ( float  f)

Hyperbolic tangent sigmoid transfer function.

Definition at line 687 of file evonet.cpp.

float trainLevembergMarquardt ( QVector< float >  trainingSet,
QVector< float >  desiredOutput,
float  maxError 
)

Train the network through the Levemberg Marquardt gradient descent algorithm.

Parameters
trainingSetthe input vector
desiredOutputthe teaching vector
maxErrorthe desired error threshold

Definition at line 2202 of file evonet.cpp.

References Evonet::computeMeanSquaredError(), Evonet::extractWeightsFromNet(), Evonet::getWeight(), Evonet::importWeightsFromVector(), farsa::max(), Evonet::maxIterations, Evonet::setInput(), and Evonet::updateNet().

float trainLevembergMarquardtThroughTime ( QVector< float >  trainingSet,
QVector< float >  desiredOutput,
int  time,
float  maxError 
)

Train the network through the Levemberg Marquardt through time gradient descent algorithm.

Parameters
trainingSetthe input vector
desiredOutputthe teaching vector
timethe number of interations in time
maxErrorthe desired error threshold

Definition at line 2512 of file evonet.cpp.

References Evonet::computeMeanSquaredError(), Evonet::extractWeightsFromNet(), Evonet::getWeight(), Evonet::importWeightsFromVector(), farsa::max(), Evonet::maxIterations, Evonet::setInput(), and Evonet::updateNet().

int updateCounts ( )

return the number of updates (step) done

The counter is resetted to zero when the Evonet is resetted (Evonet::resetNet) and is incremented by one at each call of Evonet::updateNet

Definition at line 1103 of file evonet.cpp.

void updateNet ( )

Update the state of the internal and motor neurons on the basis of: (i) the property of the neurons (stored in the vectors neurontype[], neuronbias[], neurongain[]) (ii) the update, connection, and gain blocks (stored in the matrix net_block[b][0]) (iii) the value of the free parameters.

Definition at line 752 of file evonet.cpp.

References Evonet::evonetUpdated(), DataUploader< DataType_t >::getDownloader(), Evonet::logistic(), Evonet::MAXN, Evonet::MAXSTOREDACTIVATIONS, Evonet::neuronlesion, Evonet::neuronlesions, and Evonet::neuronlesionVal.

Referenced by Evonet::computeMeanSquaredError(), Evonet::trainLevembergMarquardt(), and Evonet::trainLevembergMarquardtThroughTime().

void updateWeightsAfterBackProp ( )

Updates the weights of the ANN.

Definition at line 2175 of file evonet.cpp.

Member Data Documentation

const float DEFAULT_VALUE = -99.0f
static
int maxIterations

Maximum number of training iteration.

Definition at line 570 of file evonet.h.

Referenced by Evonet::trainLevembergMarquardt(), and Evonet::trainLevembergMarquardtThroughTime().

const int MAXN = 1000
static
const int MAXSTOREDACTIVATIONS = 100
static

The maximum number of stored activation vectors.

Definition at line 112 of file evonet.h.

Referenced by Evonet::getOldestStoredActivations(), and Evonet::updateNet().

QColor neurondcolor[MAXN]

the color used to display the actiovation state of each neuron in the neuron monitor widget

Definition at line 361 of file evonet.h.

Referenced by Evonet::configure(), Evonet::Evonet(), and EvonetIterator::setGraphicProperties().

int neurondisplay[MAXN]

the vectors that specify for each neuron whether it should be displayed or not by the neuron monitor widget

Definition at line 352 of file evonet.h.

Referenced by Evonet::create_net_block(), Evonet::Evonet(), Evonet::load_net_blocks(), and Evonet::save_net_blocks().

char neuronl[MAXN][10]

the labels of the neurons displayed by the graphic widget

Definition at line 348 of file evonet.h.

Referenced by Evonet::configure(), Evonet::Evonet(), Evonet::save_net_blocks(), and EvonetIterator::setGraphicProperties().

bool neuronlesion[MAXN]

a vector that speficy lesioned and unlesioned neurons

Definition at line 365 of file evonet.h.

Referenced by Evonet::Evonet(), and Evonet::updateNet().

int neuronlesions

Whether one or more neurons have been lesioned.

Definition at line 409 of file evonet.h.

Referenced by Evonet::Evonet(), and Evonet::updateNet().

float neuronlesionVal[MAXN]

the value to be assigned to the state of lesioned neurons

Definition at line 369 of file evonet.h.

Referenced by Evonet::Evonet(), and Evonet::updateNet().

double neuronrange[MAXN][2]

the matrix that contain the variation range of neurons used by the neuron monitor graphic widget

Definition at line 357 of file evonet.h.

Referenced by Evonet::configure(), Evonet::Evonet(), and EvonetIterator::setGraphicProperties().

int nselected

Number of parameters selected through the graphic interface Enable the user to modify the parameters manually through the graphic widget.

Definition at line 405 of file evonet.h.

float** selectedp

pointer to the list pointer-to-parameters selected through the graphic interface Enable the user to modify the parameters manually through the graphic widget

Definition at line 400 of file evonet.h.

Referenced by Evonet::Evonet().


The documentation for this class was generated from the following files: