25 :
Cluster( numNeurons, name ), tmpdata(numNeurons), tmpdata2(numNeurons) {
30 :
Cluster( params, prefix ), tmpdata(numNeurons()), tmpdata2(numNeurons()) {
32 QString str = params.
getValue(prefix +
"coefficients");
34 QStringList list = str.split(QRegExp(
"\\s+"), QString::SkipEmptyParts);
35 coeff.
resize( list.size() );
36 for(
int i=0; i<list.size(); i++) {
38 coeff[i] = list[i].toDouble(&ok);
52 ds.resize( (c.
size()>3) ? c.
size()-3 : 0 );
53 for(
int i=0; i<ds.size(); i++ ) {
60 unsigned int csize = coeff.
size();
68 tmpdata.
setAll( coeff[0] );
90 for(
int i=0; i<ds.size(); i++ ) {
92 tmpdata2 *= coeff[i+3];
99 void DDECluster::breakUpdate() {
105 void DDECluster::updateDs() {
106 if ( ds.size() == 0 )
return;
111 if ( ds.size() == 1 ) {
113 }
else if ( ds.size() == 2 ) {
120 for(
int i=0; i<ds.size(); i++ ) {
123 subtract( tmpdata2, tmpdata, ds[1] );
125 ds[i].copyValues( tmpdata );
128 subtract( tmpdata, tmpdata2, ds[i] );
130 ds[i].copyValues( tmpdata2 );
142 for (
unsigned int i = 0; i < coeff.
size(); i++) {
143 list.push_back(QString::number(coeff[i]));
150 Descriptor d =
addTypeDescription( type,
"A Cluster where the outputs depends on previous value",
"The outputs are calculated accordlying with follow equation:\n y(t) <- a0 + a1*f(x) + a2*x(t) + a3*y(t-1) + a4*y'(t-1) + a5*y''(t-1) + a6*y'''(t-1) + ... \n NOTE: a simply leaky-integrator is possible by settings coefficients in the following way:\n a0 <- 0.0 ; a1 <- delta ; a2 <- 0.0 ; a3 <- 1.0-delta\n getting:\n y(t) <- (delta)*f(x) + (1.0-delta)*y(t-1)" );