# AI::NNFLex , sum net - why doen't read correct @input set ?

#### Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Hi ,

here below is a frame of my code where  @tit  is array of

[0]: 1;1;2
[1]: 1;2;3
[2]: 2;2;4
[3]: 3;3;6
[4]: 4;1;5
[5]: 2;3;5
[6]: 5;1;6

acquired from external file, and @vect is a variable array, where I might
decide how may hidden layed adopt; it have anyway a structure like
(#input,.. ,#hidden ,..,#output).

My problem is that routine seems to works and converge, but it wont adopt
the propper input and output path (instructing with right weit), because I
make a test trying to sum different set of numbers, the net result almost
the same output for each of them...  Where am I wrong on the code ?

I've tryed also to insert the leatning path into the code (like
[[1,1],[2],[1,2],[3],[...] ) but I got the same result than before...

Thanks

Simon

.........

foreach (@tit){
chomp \$_;
@path = split/;/,\$_;
for(\$i =0 ; \$i < @path ; \$i++){
\$input .= \$path[\$i].',' if \$choose[\$i] eq 'i';
\$output.= \$path[\$i].',' if \$choose[\$i] eq 'o';
}
chop \$input;
chop \$output;
@input = split/,/,\$input;
@output = split/,/,\$output;
\$ri[\$j] = [@input];
\$ro[\$j] = [@output];
push (@data,\$ri[\$j],\$ro[\$j]);
\$j++;
\$input = \$output ='';
}
print
"\n\n\$n_strati_nascosti\n@n_strati\n\$fatt_conv\n\$errore\n\$iteraz\n@ipar\n\$ti
tolo\n";

\$dataset = AI::NNFlex::Dataset->new(\@data);
\$network = AI::NNFlex::Backprop->new(
learningrate=>\$fatt_conv/100,momentum=>.1,bias=>.01,fahlmanconstant=>.05);
\$i = 0;

foreach ( @){print "---\$_\n";}

for(\$i = 0 ; \$i < @vect ; \$i++){
if(\$i < @vect-1){
nodes=>\$vect[\$i],activationfunction=>"sigmoid");
\$e=\$E;
}else{
nodes=>\$vect[\$i],activationfunction=>"linear");
\$e=\$E;
}
}

\$network->init();

#\$network->connect(fromlayer=>2,tolayer=>2);

my \$counter=0;
my \$err = 10;
while (\$err >\$errore/1){
\$err = \$dataset->learn(\$network);
print "Epoch \$counter: Error = \$err\n";
foreach ( @){print "Epoch \$counter: Error = \$err\tOut
TMP:\$_\tll\$output\n";}
last if(\$counter > \$iteraz);
\$counter++;
}