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

Inheritance diagram for Evonet:

Signals

void evonetUpdated ()
 emitted everytime the Evonet has been updated More...
 

Public Member Functions

 Evonet ()
 The class constructor. More...
 
void activateMonitorUpdate ()
 the labels of the neurons displayed by the graphic widget More...
 
float backPropStep (QVector< float > tInput, double rate)
 Computes the neuron deltas for the Backpropagation algorithm. More...
 
float backPropStep2 (QVector< float > tInput, double rate)
 Computes the neuron deltas for the Backpropagation algorithm but does not update the weights. More...
 
void calculateBackPropagationError (QVector< float > tInput)
 Computes the Backpropagation error (the backpropagation algorithm is not applied to the ANN) More...
 
EvonetcloneNet () const
 
float computeMeanSquaredError (QVector< float > trainingSet, QVector< float > desiredOutput)
 Update the network and compute and return the mean squared error. More...
 
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]) More...
 
void configure (ConfigurationParameters &params, QString prefix)
 Configures the object using a ConfigurationParameters object. More...
 
void copyPheParameters (int *pheGene)
 transorm floating point parameters normalized in the range [-wrange,range] into integer parameters in the range [0,255] More...
 
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. More...
 
void deactivateMonitorUpdate ()
 deactivate the neurons monitor update More...
 
void endTraining ()
 de-allocate variables create for training More...
 
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. More...
 
int freeParameters ()
 return number of defined free parameters More...
 
float * getActivations ()
 
float getBackPropError ()
 Returns the Backpropagation algorithm error. More...
 
float * getBackPropWeightModification ()
 Returns the array of weight/bias updates after backpropagation. More...
 
float getBrange ()
 return the value of brange More...
 
float * getCopyBackPropFreep ()
 
EvonetUIgetCurrentUIManager () const
 Returns the current instance of the UI manager. More...
 
float getFreeParameter (int i)
 return the value of the ith parameter (normalized in the range [-wrange, wrange] More...
 
float getGrange ()
 return the value of grange More...
 
float getHidden (int h)
 return the value of a hidden neuron (-999 if the specified id is out of range) More...
 
float getInput (int in)
 return the value of a sensory neuron More...
 
void getMutations (float *mut)
 set the mutation vector of the genetic algorithm that determine how parameters are mutated More...
 
float * getNetInputs ()
 
const QString & getNetworkName () const
 Returns the name of this neural network. More...
 
float getNeuron (int in)
 return the activation of a neuron More...
 
DataUploader< ActivationsToGui > * getNeuronsMonitorUploader ()
 Returns the uploader for activations. More...
 
int getNoHiddens ()
 return the number of internal neurons More...
 
int getNoInputs ()
 return the number of sensory neurons More...
 
int getNoNeurons ()
 return the total number of neurons More...
 
int getNoOutputs ()
 return the number of motor neurons More...
 
float * getOldestStoredActivations ()
 Returns the oldest stored activation vector and removes it. More...
 
float getOutput (int out)
 return the value of a motor neuron (-1 if the specified id is out of range) More...
 
int getParamBias (int nbias)
 return the value of a bias More...
 
float getTeachingInputEntry (int id)
 Returns the value of the teaching input element in id position. More...
 
ParameterSettableUIgetUIManager ()
 Return a new instance of the EvonetUI. More...
 
float getWeight (int to, int from)
 Return the weight that depart from neuron "from" and reach neuron "to". More...
 
float getWrange ()
 return the value of wrange (which also determine the range in which all parameters are normalized) More...
 
void hardwire ()
 Experiment specific function that set the weights for a reflex and set the weights that should not be trained to 0.0. More...
 
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. More...
 
void initBackPropFreep ()
 Initializes backpropfreep for applying backPropStep2 algorithm. More...
 
void initCopyBackPropFreep ()
 
void initWeightsInRange (float min, float max)
 Initializes weights and biases randomly. More...
 
void initWeightsInRange (float minBias, float maxBias, float minWeight, float maxWeight)
 Initializes weights and biases randomly. More...
 
void initWeightsNguyenWidrow (float min, float max)
 Initializes weights and biases according to the Nguyen-Widrow initialization algorithm. More...
 
void injectHidden (int nh, float val)
 set the actiovation state of a hidden neuron More...
 
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) More...
 
float logistic (float f)
 logistic function More...
 
bool pheFileLoaded ()
 check whether a .phe file (with parameters description) has been loaded More...
 
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. More...
 
void printAct ()
 Print neurons activation state. More...
 
void printBlocks ()
 display the architecture structure More...
 
void printIO ()
 Print the activation state of sensory, internal, and motor neurons. More...
 
void printWeights ()
 Print all free parameters. More...
 
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. More...
 
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. More...
 
void resetNet ()
 reset to 0.0 the activation state of all neurons More...
 
void save (ConfigurationParameters &params, QString prefix)
 Saves the actual status of parameters into the ConfigurationParameters object passed. More...
 
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) More...
 
void saveCopyBackPropFreep ()
 
int setInput (int inp, float value)
 set the value of a sensory neuron More...
 
void setNeckReflex ()
 Experiment specific function that set certain weights so to provide a given reflex behavior. More...
 
void setNetworkName (const QString &name)
 Sets the name of this neural network. More...
 
void setParameters (const float *dt)
 set the free parameters on the basis of a genotype string More...
 
void setParameters (const int *dt)
 set the free parameters on the basis of a genotype string More...
 
void setRanges (double weight, double bias, double gain)
 set the range of connection weights, biases, and gains More...
 
void setWeight (int to, int from, float w)
 Set the weight that depart from neuron "from" and reach neuron "to". More...
 
bool showTeachingInput ()
 Checks whether the teaching input has to be shown. More...
 
float tansig (float f)
 Hyperbolic tangent sigmoid transfer function. More...
 
float trainLevembergMarquardt (QVector< float > trainingSet, QVector< float > desiredOutput, float maxError)
 Train the network through the Levemberg Marquardt gradient descent algorithm. More...
 
float trainLevembergMarquardtThroughTime (QVector< float > trainingSet, QVector< float > desiredOutput, int time, float maxError)
 Train the network through the Levemberg Marquardt through time gradient descent algorithm. More...
 
int updateCounts ()
 return the number of updates (step) done More...
 
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. More...
 
void updateWeightsAfterBackProp ()
 Updates the weights of the ANN. More...
 
- Public Member Functions inherited from ParameterSettable
void addObserver (RuntimeParameterObserver *obs)
 
getRuntimeParameter (QString paramName)
 
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. More...
 
- Static Public Member Functions inherited from ParameterSettable
static void describe (QString type)
 
static QString fullParameterDescriptionPath (QString type, QString param)
 
static QString fullSubgroupDescriptionPath (QString type, QString sub)
 

Public Attributes

int maxIterations
 Maximum number of training iteration. More...
 
QColor neurondcolor [MAXN]
 the color used to display the actiovation state of each neuron in the neuron monitor widget More...
 
int neurondisplay [MAXN]
 the vectors that specify for each neuron whether it should be displayed or not by the neuron monitor widget More...
 
char neuronl [MAXN][10]
 
bool neuronlesion [MAXN]
 a vector that speficy lesioned and unlesioned neurons More...
 
int neuronlesions
 Whether one or more neurons have been lesioned. More...
 
float neuronlesionVal [MAXN]
 the value to be assigned to the state of lesioned neurons More...
 
double neuronrange [MAXN][2]
 the matrix that contain the variation range of neurons used by the neuron monitor graphic widget More...
 
int nselected
 Number of parameters selected through the graphic interface Enable the user to modify the parameters manually through the graphic widget. More...
 
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 More...
 
bool updateNeuronMonitor
 Set to true if labels or colors have to be updated in the neuron monitor. More...
 
- 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. More...
 
static const int MAXN = 1000
 Maximum number of neurons for a neural network of this type. More...
 
static const int MAXSTOREDACTIVATIONS = 100
 The maximum number of stored activation vectors. More...
 
- 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 ParameterSettable
enum  Property
 
- Protected Member Functions inherited from ParameterSettable
void notifyChangesToParam (QString paramName)
 
- Static Protected Member Functions inherited from ParameterSettable
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 121 of file evonet.h.

Constructor & Destructor Documentation

Member Function Documentation

void activateMonitorUpdate ( )

the labels of the neurons displayed by the graphic widget

activate the neurons monitor update

Definition at line 2036 of file evonet.cpp.

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 2055 of file evonet.cpp.

References 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 2194 of file evonet.cpp.

References 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 2334 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 1601 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 777 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 179 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::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 1120 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 348 of file evonet.cpp.

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

Referenced by Evonet::configure().

void deactivateMonitorUpdate ( )

deactivate the neurons monitor update

Definition at line 2040 of file evonet.cpp.

void describe ( QString  type)
static

Add to Factory::typeDescriptions() the descriptions of all parameters and subgroups.

Definition at line 323 of file evonet.cpp.

References ParameterSettable::addTypeDescription(), ParameterSettable::Infinity, and Evonet::MAXN.

void endTraining ( )

de-allocate variables create for training

Definition at line 2023 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 1645 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 2050 of file evonet.cpp.

float * getBackPropWeightModification ( )

Returns the array of weight/bias updates after backpropagation.

Returns
the backpropagation updates vector

Definition at line 2390 of file evonet.cpp.

float getBrange ( )

return the value of brange

Definition at line 1167 of file evonet.cpp.

EvonetUI* getCurrentUIManager ( ) const
inline

Returns the current instance of the UI manager.

Note that the function is const, but the returned ui manager is not.

Returns
the current instance of the UI manager

Definition at line 172 of file evonet.h.

float getFreeParameter ( int  i)

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

Definition at line 1075 of file evonet.cpp.

Referenced by Evoga::updateGenomeFromEvonet(), and Evoga::xnes().

float getGrange ( )

return the value of grange

Definition at line 1172 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 1061 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 1033 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 1112 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 174 of file evonet.cpp.

float getNeuron ( int  in)

return the activation of a neuron

Parameters
inthe id number of the neuron

Definition at line 1038 of file evonet.cpp.

DataUploader<ActivationsToGui>* getNeuronsMonitorUploader ( )
inline

Returns the uploader for activations.

Returns
the uploader for activations

Definition at line 181 of file evonet.h.

Referenced by EvonetUI::changeNet().

int getNoHiddens ( )

return the number of internal neurons

Definition at line 1201 of file evonet.cpp.

Referenced by EvonetIterator::setGraphicProperties().

int getNoInputs ( )

return the number of sensory neurons

Definition at line 1196 of file evonet.cpp.

Referenced by EvonetIterator::setGraphicProperties().

int getNoNeurons ( )

return the total number of neurons

Definition at line 1211 of file evonet.cpp.

int getNoOutputs ( )

return the number of motor neurons

Definition at line 1206 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 1223 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 1025 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 1153 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 2045 of file evonet.cpp.

ParameterSettableUI * getUIManager ( )
virtual

Return a new instance of the EvonetUI.

Reimplemented from ParameterSettable.

Definition at line 343 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 1893 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 1162 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 1355 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 1774 of file evonet.cpp.

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

void initBackPropFreep ( )

Initializes backpropfreep for applying backPropStep2 algorithm.

Definition at line 2351 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 1247 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

Parameters
minBiasthe minimum value of the biases
maxBiasthe maximum value of the biases
minWeightthe minimum value of the weights
maxWeightthe maximum value of the weights

Definition at line 1273 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 1301 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 1054 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 515 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 764 of file evonet.cpp.

Referenced by Evonet::updateNet().

bool pheFileLoaded ( )

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

Definition at line 1080 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 1945 of file evonet.cpp.

void printAct ( )

Print neurons activation state.

Definition at line 1592 of file evonet.cpp.

void printBlocks ( )

display the architecture structure

Definition at line 1178 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 1132 of file evonet.cpp.

References Logger::info().

void printWeights ( )

Print all free parameters.

Definition at line 1239 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 621 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 612 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 1043 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 ParameterSettable.

Definition at line 309 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 658 of file evonet.cpp.

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

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 1016 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 3212 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 169 of file evonet.cpp.

void setParameters ( const float *  dt)

set the free parameters on the basis of a genotype string

Parameters
dfthe pointer to the vector of genotype floats

Definition at line 1088 of file evonet.cpp.

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

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 1100 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 1216 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 1918 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 2031 of file evonet.cpp.

float tansig ( float  f)

Hyperbolic tangent sigmoid transfer function.

Definition at line 769 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 2442 of file evonet.cpp.

References Evonet::computeMeanSquaredError(), Evonet::extractWeightsFromNet(), Evonet::getWeight(), Evonet::importWeightsFromVector(), 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 2752 of file evonet.cpp.

References Evonet::computeMeanSquaredError(), Evonet::extractWeightsFromNet(), Evonet::getWeight(), Evonet::importWeightsFromVector(), 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 1234 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 834 of file evonet.cpp.

References Evonet::evonetUpdated(), Evonet::logistic(), Evonet::MAXN, Evonet::MAXSTOREDACTIVATIONS, Evonet::neurondcolor, Evonet::neuronlesion, Evonet::neuronlesions, Evonet::neuronlesionVal, and Evonet::updateNeuronMonitor.

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

void updateWeightsAfterBackProp ( )

Updates the weights of the ANN.

Definition at line 2364 of file evonet.cpp.

Member Data Documentation

const float DEFAULT_VALUE = -99.0f
static
int maxIterations

Maximum number of training iteration.

Definition at line 649 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 133 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 419 of file evonet.h.

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

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 410 of file evonet.h.

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

bool neuronlesion[MAXN]

a vector that speficy lesioned and unlesioned neurons

Definition at line 423 of file evonet.h.

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

int neuronlesions

Whether one or more neurons have been lesioned.

Definition at line 471 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 427 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 415 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 467 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 462 of file evonet.h.

Referenced by Evonet::Evonet().

bool updateNeuronMonitor

Set to true if labels or colors have to be updated in the neuron monitor.

Definition at line 431 of file evonet.h.

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


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