I have a neural network with two output nodes and I am writing back propagation algorithm for it in c#. and this is how I am calculating instance error
instanceErr += (double)((Math.Pow(error1[0], 2) + Math.Pow(error1[1], 2)) / 2);
this code is inside a loop with executes for 224 time as I have 224 instances.Is this the right way to do it? after that I calculate the error per epoch like this.
meanSqrE = (double) (instanceErr/224);
but after the 2 epochs, it starts giving me same error 30 times and after that it prints this NaN
. I have no idea where I go wrong