Within a Neural Network during the learning phase ,there are two mechanisms happening. Feedforward and Backpropagation. Taking an example of XOR operation.
A B Q
0 0 0
0 1 1
1 0 1
1 1 0
For the first pass(0,0->0) feedforward takes place, then backpropagation happens.After this step all the weights are recalculated .
What happens now?
Question-1:Again the same input 0,0 is feedforward with the new calculated weights(during the backpropagation) and then backprogated until the error becomes nill? If yes, what happens if the error is never nill? Which brings me to the next question.
Question-2:When would the learning for the next pass(0,1->1) happen?
Question-3: Suppose the concluded weights for the 1st pass is 10.3,-2.3,5.5 .The second pass(0,1->1) starts the feedforward with the concluded weights of the first pass?
If I have to describe via code which of the following code would be correct
Common Code for the below options
averageErrorUntilLearn = 0.002;
inputs = [
[0, 0],
[0, 1],
[1, 0],
[1, 1]
];
outputs = [0, 1, 1, 0];
inputNeurons = 2;
hiddenLayers = 1;
outputNeurons = 1;
//initialize the Neural Net
neuralNetObj = NeuralNet();
neuralNetObj.createTopology(inputNeurons, hiddenLayers, outputNeurons);
weightsForTheNetwork = randomWeights();
Question 3 scenario-
The weights calculated in each pass is sent down to the next pass
//learn
while (averageError > averageErrorUntilLearn):
for i in range(0,len(input)):
console.log("Current Pass-" + i);
neuralNetObj.learningParams(inputs[i], outputs[i]);
neuralNetObj.initializeWeights(weightsForTheNetwork);
neuralNetObj.feedforward();
neuralNetObj.backPropagate();
weightsForTheNetwork=neuralNetObj.getNewWeights();
averageError = neuralNetObj.getAverageError();
Question 1 scenario- Each pass is calculated with its own weights till it reaches the desired learning and then the weights are sent down the new pass
//learn
for i in range(0,len(input)):
while (averageError > averageErrorUntilLearn):
console.log("Current Pass-" + i);
neuralNetObj.learningParams(inputs[i], outputs[i]);
neuralNetObj.initializeWeights(weightsForTheNetwork);
neuralNetObj.feedforward();
neuralNetObj.backPropagate();
weightsForTheNetwork = neuralNetObj.getNewWeights();
averageError = neuralNetObj.getAverageError();
Or am I complete wrong here and none of the above scenarios are true?