I am trying to implement backpropagation with recursion for academic purposes, but it seems like I was mistaken somewhere. For some time they did this, but either did not study at all, or did not study according to the second model.
Please let me know where I was wrong. (This is javascript syntax) Note: errors reset to null before each training cycle.
this.backpropagate = function(oAnn, aTargetOutput, nLearningRate) { nLearningRate = nLearningRate || 1; var oNode, n = 0; for (sNodeId in oAnn.getOutputGroup().getNodes()) { oNode = oAnn.getOutputGroup().getNodes()[sNodeId]; oNode.setError(aTargetOutput[n] - oNode.getOutputValue()); n ++; } for (sNodeId in oAnn.getInputGroup().getNodes()) { this.backpropagateNode(oAnn.getInputGroup().getNodes()[sNodeId], nLearningRate); } } this.backpropagateNode = function(oNode, nLearningRate) { var nError = oNode.getError(), oOutputNodes, oConn, nWeight, nOutputError, nDerivative = oNode.getOutputValue() * (1 - oNode.getOutputValue()),
source share