Hi everyone,
Could any one help me with this code, please. I do not know why it's giving this kind of error. The code, which is a part of a lager program, is as given below. I will try explaining what each variables represent.
public void backwardComputation(int m, Double desiredOutput[][])
{
int i, j = 0;
deltaOutput[j] = (1 * (desiredOutput[m][j] - targetOutputA[j]));
System.out.println(deltaOutput[j]);
for(i = 0; i < hiddenNeurons; i++)
for(j = 0; j < outputNeurons; j++)
deltaHidden[i]=((hiddenA[i]*(1 - hiddenA[i]))*(deltaOutput[j] * outputToHiddenWeight[i][j]));
}
Let us say the variables outputNeurons and hiddenNeurons are given as 1 and 3 respectively, but each time i attempt to store ((hiddenA[i](1 - hiddenA[i]))(deltaOutput[j] * outputToHiddenWeight[i][j])); into the array deltaHidden[i], it gives an error "Exception in thread "main" java.lang.ArrayIndexOutOfBoundExceptions: 1" and I have checked that the array deltaHidden[] have enough spaces, and that all other arrays in the equation work out fine. Can you help looking into this please?