Pattern object. More...

Inheritance diagram for Pattern:

Classes

class  PatternInfo
 

Public Member Functions

 Pattern ()
 Construct an empty Pattern.
 
 ~Pattern ()
 Destructor.
 
virtual void configure (ConfigurationParameters &params, QString prefix)
 Configures the object using a ConfigurationParameters object.
 
DoubleVector inputsOf (Cluster *) const
 return stored information if exists, otherwise it return a zero vector
 
PatternInfooperator[] (Cluster *)
 return the stored information
 
DoubleVector outputsOf (Cluster *) const
 return stored information if exists, otherwise it return a zero vector
 
virtual void save (ConfigurationParameters &params, QString prefix)
 Save the actual status of parameters into the ConfigurationParameters object passed.
 
void setInputsOf (Cluster *, const DoubleVector &)
 set the inputs associated with Cluster passed
 
void setInputsOutputsOf (Cluster *, const DoubleVector &inputs, const DoubleVector &outputs)
 set the both inputs and outputs associated with Cluster passed
 
void setOutputsOf (Cluster *, const DoubleVector &)
 set the outputs associated with Cluster passed
 
- Public Member Functions inherited from ParameterSettableWithConfigureFunction
void addObserver (RuntimeParameterObserver *obs)
 
getRuntimeParameter (QString paramName)
 
virtual ParameterSettableUIgetUIManager ()
 
 ParameterSettable ()
 
virtual void postConfigureInitialization ()
 
void removeObserver (RuntimeParameterObserver *obs)
 
void setRuntimeParameter (QString paramName, T newvalue)
 
QString typeName () const
 
- Public Member Functions inherited from ParameterSettable
void addObserver (RuntimeParameterObserver *obs)
 
getRuntimeParameter (QString paramName)
 
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 void describe (QString type)
 
static QString fullParameterDescriptionPath (QString type, QString param)
 
static QString fullSubgroupDescriptionPath (QString type, QString sub)
 
- 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)
 

Additional Inherited Members

- Public Types inherited from ParameterSettableWithConfigureFunction
enum  Property
 
- Public Attributes inherited from ParameterSettableWithConfigureFunction
 AllowMultiple
 
 Default
 
 IsList
 
 IsMandatory
 
- Static Public Attributes inherited from ParameterSettableWithConfigureFunction
static const double Infinity
 
static const int MaxInteger
 
static const int MinInteger
 
- 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

Pattern object.

Motivation
The Pattern object represent a configuration (partial or complete) of the network that can be used by a learning algorithm as model to learn. A LearningAlgorithm will use Pattern for setup network's inputs, spread network and eventually calculate the error, and modify the network's paramenters on the basis of neurons activities in order to get closer to neuron activities presented by the Pattern
Description
Pattern simply associates inputs/outputs pairs to Clusters:
Pattern pat;
pat->setInputsOf( anInputCluster, Inputs );
pat->setOutputsOf( anOutputCluster, Outputs );
pat->setInputOutputsOf( anHiddenClusterToReset, Inputs, Outputs );
//--- retrieve stored information:
pat[aCluster].inputs;
pat[anotherCluster].outputs;
//--- add/modify informations:
pat[aNewCluster].outputs.assign( aRealVecOfData );
pat[aNewCluster].outputs += 3.0;
Warnings
Pay attention when you use operator[] because it silently add new data. Like QMap::operator[]

Definition at line 66 of file learningalgorithm.h.

Constructor & Destructor Documentation

Pattern ( )
inline

Construct an empty Pattern.

Definition at line 74 of file learningalgorithm.h.

~Pattern ( )
inline

Destructor.

Definition at line 76 of file learningalgorithm.h.

Member Function Documentation

void configure ( ConfigurationParameters params,
QString  prefix 
)
virtual

Configures the object using a ConfigurationParameters object.

The Pattern has to be declared using a sequence of parameters with the following schema:

[aPattern]
cluster:1 = nameOfCluster
inputs:1 = list of the inputs associated to cluster:1
outputs:1 = list of the outputs associated to cluster:1
...
cluster:i = nameOf_ith_Cluster
inputs:i = list of the inputs associated to cluster:i
outputs:i = list of the outputs associated to cluster:i

Essentialy, the parameters are grouped using the identifier string after the ':' char. And the inputs and outputs with a given identifier are associated to the cluster with the same identifier. If a cluster:i is present, then at least inputs:i or outputs:i parameter must be present

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 63 of file learningalgorithm.cpp.

References DoubleVector::append(), ConfigurationParameters::getObjectFromParameter(), ConfigurationParameters::getParametersWithPrefixList(), ConfigurationParameters::getValue(), Pattern::setInputsOf(), Pattern::setOutputsOf(), and DoubleVector::size().

DoubleVector inputsOf ( Cluster cl) const

return stored information if exists, otherwise it return a zero vector

Definition at line 43 of file learningalgorithm.cpp.

Referenced by BackPropagationAlgo::calculateMSE(), and BackPropagationAlgo::learn().

Pattern::PatternInfo & operator[] ( Cluster cl)

return the stored information

Warning
it silently create a new one if the Cluster passed is not present

Definition at line 59 of file learningalgorithm.cpp.

DoubleVector outputsOf ( Cluster cl) const

return stored information if exists, otherwise it return a zero vector

Definition at line 51 of file learningalgorithm.cpp.

Referenced by BackPropagationAlgo::calculateMSE(), and BackPropagationAlgo::learn().

void save ( ConfigurationParameters params,
QString  prefix 
)
virtual

Save 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 97 of file learningalgorithm.cpp.

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

void setInputsOf ( Cluster cl,
const DoubleVector ins 
)

set the inputs associated with Cluster passed

Definition at line 26 of file learningalgorithm.cpp.

References Cluster::numNeurons().

Referenced by Pattern::configure().

void setInputsOutputsOf ( Cluster cl,
const DoubleVector inputs,
const DoubleVector outputs 
)

set the both inputs and outputs associated with Cluster passed

Definition at line 36 of file learningalgorithm.cpp.

References Cluster::numNeurons().

void setOutputsOf ( Cluster cl,
const DoubleVector ous 
)

set the outputs associated with Cluster passed

Definition at line 31 of file learningalgorithm.cpp.

References Cluster::numNeurons().

Referenced by Pattern::configure().


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