Grokking-Deep-Learning
Grokking-Deep-Learning copied to clipboard
fix: chapter8 batch processing
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.