swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in Neurolib 1.4.1


From: Konrad Lang
Subject: Bug in Neurolib 1.4.1
Date: Sat, 5 Jun 1999 01:47:08 +0200 (MEST)

I just came over a part of Neurolib 1.4.1 that seems not to work as
expected:
in Hebb2Layer.m, method:
- setFromString: (unsigned char *)_str
The weights are initialized from the given string, but for the weights in
the hidden layer the same offset in the string is taken ...

for (i = 0; i < inpSize * hidSize; i++)
    {
      foo = 0;
      for ( j = 0; j < BYTESWGT; j ++ )   
        // Little-endian order + sign  
        foo += powers[j]*_str[i*BYTESWGT+j];
      Wgts1[i] = (foo*2) / (powers[BYTESWGT-1]*256.0) -1;
      fprintf( stderr,"Weight %d %f\n", i, Wgts1[i] );
    }
 
  for (i = 0; i < opSize * hidSize; i++)
    {
      foo = 0;
      for ( j = 0; j < BYTESWGT; j ++ )
        // Little-endian order + sign
->        foo += powers[j]*_str[i*BYTESWGT+j];
      Wgts2[i] = (foo*2)/(powers[BYTESWGT-1]*256.0) -1;
        fprintf( stderr,"Weight %d %f\n", i, Wgts2[i] );
    }

the (->) should be replaced by:
           foo += powers[j]*_str[(inpSize * hidSize)+i*BYTESWGT+j];
to make sure that all the values are set from different locations out
of the string ...

konrad

-------
  ICQ#: 23489351
  Lang Konrad               Student of Computer Science in Salzburg, Austria
-------
At the source of every error which is blamed on the computer you will find
at least two human errors, including the error of blaming it on the computer.


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]