jeffheaton / encog-java-core

http://www.heatonresearch.com/encog
Other
742 stars 268 forks source link

Gradient is zero #261

Open PLEXATIC opened 2 years ago

PLEXATIC commented 2 years ago

The function Train.getLastGradient() will return an array containing only zeros, if it is called after Train.iteration(). This is still true even if Train.calculateGradients() is called right before. Also, inside the Function Train.updateWeight(double[] gradients, double[] lastGradients, int index), the lastGradients appear to be only zeros as well. I did a quick check and found that the learn() Function seems to allways reset the gradient values to 0, so this might be the source of the issue. If someone could confirm that this is a bug, I would be happy to attempt to fix it.