22 #include "configurationhelper.h"
28 :
Updatable(name), inputdata(numNeurons,true), outputdata(numNeurons,true), stateDelegates() {
30 setDelegateFor<Cluster, &Cluster::inputs>(
"inputs" );
31 setDelegateFor<Cluster, &Cluster::outputs>(
"outputs" );
44 Updatable(params, prefix), stateDelegates()
47 setDelegateFor<Cluster, &Cluster::inputs>(
"inputs" );
48 setDelegateFor<Cluster, &Cluster::outputs>(
"outputs" );
60 QString vectorSizeErrorTmpl(
"The number of elements of the %1 vector in configuration file (%1) is different from the number of neurons (%2)");
64 if ( !vect.isEmpty() && vect.size() != (int)numneurons ) {
65 qWarning() << vectorSizeErrorTmpl.arg(
"inputs" ).arg( vect.size() ).arg( numneurons );
73 if ( !vect.isEmpty() && vect.size() != (int)numneurons ) {
74 qWarning() << vectorSizeErrorTmpl.arg(
"outputs" ).arg( vect.size() ).arg( numneurons );
82 }
catch( std::exception& ) {
95 updater->setCluster(
this );
99 (*inputdataptr)[neuron] = value;
121 (*outputdataptr)[neuron] = value;
136 params.
createParameter(prefix,
"numNeurons", QString::number(numneurons));
151 updater->save( params, params.
createSubGroup(prefix,
"OutFunction") );
158 d.
describeBool(
"accumulate" ).
def(
false ).
help(
"If true new inputs will be added to the previous values" );
161 d.
describeObject(
"OutFunction" ).
type(
"OutputFunction" ).
help(
"The output function used to calculate the output values" );