views:

71

answers:

1

I am using an external library for Artificial Neural Networks in my project..

While testing the ANN, It gave me output of all NaN (not a number in C#)

  • The ANN has 8 input , 5 hidden , 5 hidden , 2 output, and all activation layers are of Linear type , and it uses back-propagation, with learning rate 0.65

  • I used one testcase for training { -2.2, 1.3, 0.4, 0.5, 0.1, 5, 3, -5 } ,{ -0.3, 0.2 } for 1000 epoch

  • And I tested it on { 0.2, -0.2, 5.3, 0.4, 0.5, 0, 35, 0.0 } which gave { NaN , NaN} Note: this is one example of many that produces same case...

I am trying to discover whether it is a bug in the library, or an illogical configuration..

The reasons I could think of for illogical configuration:

  • All layers should not be linear
  • Can not have descending size layers, i.e 8-5-5-2 is bad..
  • Only one testcase ?
  • Values must be in range [0,1] or [-1,1]

Is any of the above reasons could be the cause of error, or there are some constraints/rules that I do not know in ANN designing..?

Note: I am newbie in ANN

+2  A: 

Well, with out knowing anything about the library you are using it is not easy to guess. Typically a ANN inputs are required to be between 0..1 or -1..1, so maybe it is because you have values outside of that range causing the unfortunate results.

If the above is the cause of the problem, there are a number of techniquest for encoding data to be passed to a ANN, for example you could scale your inputs to ensure they are always in range and maintain the relative relationship.

Chris Taylor