diff --git a/Chapter8 - Intro to Regularization - Learning Signal and Ignoring Noise.ipynb b/Chapter8 - Intro to Regularization - Learning Signal and Ignoring Noise.ipynb index 8aa7057..505a480 100644 --- a/Chapter8 - Intro to Regularization - Learning Signal and Ignoring Noise.ipynb +++ b/Chapter8 - Intro to Regularization - Learning Signal and Ignoring Noise.ipynb @@ -426,12 +426,12 @@ " for k in range(batch_size):\n", " correct_cnt += int(np.argmax(layer_2[k:k+1]) == np.argmax(labels[batch_start+k:batch_start+k+1]))\n", "\n", - " layer_2_delta = (labels[batch_start:batch_end]-layer_2)/batch_size\n", - " layer_1_delta = layer_2_delta.dot(weights_1_2.T)* relu2deriv(layer_1)\n", - " layer_1_delta *= dropout_mask\n", + " layer_2_delta = (labels[batch_start:batch_end]-layer_2)\n", + " layer_1_delta = layer_2_delta.dot(weights_1_2.T)* relu2deriv(layer_1)\n", + " layer_1_delta *= dropout_mask\n", "\n", - " weights_1_2 += alpha * layer_1.T.dot(layer_2_delta)\n", - " weights_0_1 += alpha * layer_0.T.dot(layer_1_delta)\n", + " weights_1_2 += alpha * layer_1.T.dot(layer_2_delta)\n", + " weights_0_1 += alpha * layer_0.T.dot(layer_1_delta)\n", " \n", " if(j%10 == 0):\n", " test_error = 0.0\n", @@ -482,4 +482,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file