Skip to content

Commit fd86608

Browse files
committed
Bugfixing deep_learning
1 parent d36cb2a commit fd86608

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

code/deep_learning.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,14 @@ def SGD_final_layer(
3737
``training_data`` is the input to the whole Network, not the
3838
encoded training data input to the final layer.
3939
"""
40-
net = Network([self.sizes[-2], self.sizes[-1]])
4140
encoded_training_data = [
4241
(self.feedforward(x, start=0, end=-1), y) for x, y in training_data]
42+
net = Network([self.sizes[-2], self.sizes[-1]])
43+
net.biases[-1] = self.biases[-1]
44+
net.weights[-1] = self.weights[-1]
4345
net.SGD(encoded_training_data, epochs, mini_batch_size, eta,
4446
lmbda, test, test_inputs, actual_test_results)
45-
self.biases[-1] = self.biases[-1]
47+
self.biases[-1] = net.biases[-1]
4648
self.weights[-1] = net.weights[-1]
4749

4850

0 commit comments

Comments
 (0)