Evonet is the neural network taken from the EvoRobot. More...
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... | |
Evonet * | cloneNet () 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 ¶ms, 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 () |
EvonetUI * | getCurrentUIManager () 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... | |
ParameterSettableUI * | getUIManager () |
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 ¶ms, 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) |
T | 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
Constructor & Destructor Documentation
Evonet | ( | ) |
The class constructor.
Definition at line 62 of file evonet.cpp.
References Evonet::MAXN, Evonet::neurondcolor, Evonet::neurondisplay, Evonet::neuronlesion, Evonet::neuronlesions, Evonet::neuronlesionVal, Evonet::neuronrange, Evonet::selectedp, and Evonet::updateNeuronMonitor.
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
-
tInput the input vector rate the 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
-
tInput the input vector rate the 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
-
tInput the 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
-
trainingSet the input vector desiredOutput the 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().
|
virtual |
Configures the object using a ConfigurationParameters object.
- Parameters
-
params the configuration parameters object with parameters to use prefix the 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
-
pheGene the 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.
|
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.
|
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().
int freeParameters | ( | ) |
return number of defined free parameters
Definition at line 1070 of file evonet.cpp.
Referenced by Evonet::copyPheParameters(), Evonet::getMutations(), Evoga::getPheParametersAndMutationsFromEvonet(), Evonet::getWeight(), Evonet::initWeightsInRange(), Evonet::printWeights(), Evonet::save_net_blocks(), and Evonet::setParameters().
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.
|
inline |
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
-
h the 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
-
in the 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
-
mut the 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
-
in the id number of the neuron
Definition at line 1038 of file evonet.cpp.
|
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
-
out the 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
-
h the 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
-
id the index of the teaching input desired value
- Returns
- the value of the teaching input element
Definition at line 2045 of file evonet.cpp.
|
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
-
min the minimum value of the weights max the 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
-
minBias the minimum value of the biases maxBias the maximum value of the biases minWeight the minimum value of the weights maxWeight the 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
-
min the minimum value of the weights max the 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
-
nh the id number of the hidden val the 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
-
filename the filename in which the description is contained mode 0=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
-
f the 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
-
QStringList the 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
-
QStringList the 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().
|
virtual |
Saves the actual status of parameters into the ConfigurationParameters object passed.
- Parameters
-
params the configuration parameters object on which save actual parameters prefix the 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
-
filename the filename in which the description is contained mode 0=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
-
inp the id number of the sensory neuron value the 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
-
name the 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
-
df the 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
-
df the 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
-
weight the range of weights bias the range of biases gain the 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
-
trainingSet the input vector desiredOutput the teaching vector maxError the 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
-
trainingSet the input vector desiredOutput the teaching vector time the number of interations in time maxError the 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
|
static |
DEFAULT_VALUE is used for do not assign values to mut and parameters.
Definition at line 137 of file evonet.h.
Referenced by TestRandom::buildRandomDNA(), Evonet::configure(), Evoga::copyGenes(), Evonet::copyPheParameters(), Evoga::getGenome(), Evoga::postConfigureInitialization(), Evonet::readNewPheLine(), Evonet::readOldPheLine(), Evonet::save_net_blocks(), and Evoga::setInitialPopulation().
int maxIterations |
Maximum number of training iteration.
Definition at line 649 of file evonet.h.
Referenced by Evonet::trainLevembergMarquardt(), and Evonet::trainLevembergMarquardtThroughTime().
|
static |
Maximum number of neurons for a neural network of this type.
Definition at line 135 of file evonet.h.
Referenced by Evonet::backPropStep(), Evonet::backPropStep2(), Evonet::computeParameters(), Evonet::configure(), Evonet::describe(), Evonet::Evonet(), Evonet::load_net_blocks(), Evonet::resetNet(), and Evonet::updateNet().
|
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 |
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:
- experiments/include/evonet.h
- experiments/src/evonet.cpp