Grokking-Deep-Learning icon indicating copy to clipboard operation
Grokking-Deep-Learning copied to clipboard

fix: chapter8 batch processing

Open andreinechaev opened this issue 5 years ago • 1 comments

andreinechaev avatar Nov 20 '20 12:11 andreinechaev

Hi! I agree with this pull request. Doing the batch update like this commit is more consistent with the explanations and the network learning process is much fast. I will change the calculation of layer_2_delta too.

from: layer_2_delta = (labels[batch_start:batch_end]-layer_2)

to: layer_2_delta = (layer_2-labels[batch_start:batch_end])

and the weights update:

weights_1_2 -= alpha * layer_1.T.dot(layer_2_delta) weights_0_1 -= alpha * layer_0.T.dot(layer_1_delta)

In order to be more consistent with previous chapters.

JorgeDuenasLerin avatar Aug 17 '21 17:08 JorgeDuenasLerin