|
20 | 20 |
|
21 | 21 | import mnist_loader
|
22 | 22 | training_data, validation_data, test_data = mnist_loader.load_data_wrapper()
|
| 23 | +training_data = list(training_data) |
23 | 24 |
|
24 | 25 | # ---------------------
|
25 | 26 | # - network.py example:
|
26 | 27 |
|
27 |
| -# import network |
28 |
| -# net = network.Network([784, 30, 10]) |
29 |
| -# net.SGD(training_data, 30, 10, 3.0, test_data=test_data) |
| 28 | +import network |
| 29 | +net = network.Network([784, 30, 10]) |
| 30 | +net.SGD(training_data, 30, 10, 3.0, test_data=test_data) |
30 | 31 |
|
31 | 32 | # ----------------------
|
32 | 33 | # - network2.py example:
|
33 | 34 |
|
34 |
| -import network2 |
35 |
| -net = network2.Network([784, 30, 10], cost=network2.CrossEntropyCost) |
36 |
| -#net.large_weight_initializer() |
37 |
| -net.SGD(training_data, 30, 10, 0.1, lmbda = 5.0,evaluation_data=validation_data, monitor_evaluation_accuracy=True) |
| 35 | +# import network2 |
| 36 | +# net = network2.Network([784, 30, 10], cost=network2.CrossEntropyCost) |
| 37 | +# #net.large_weight_initializer() |
| 38 | +# net.SGD(training_data, 30, 10, 0.1, lmbda = 5.0,evaluation_data=validation_data, |
| 39 | +# monitor_evaluation_accuracy=True) |
| 40 | + |
| 41 | + |
| 42 | +# chapter 3 - Overfitting and regularization example |
| 43 | +# import network2 |
| 44 | +# net = network2.Network([784, 30, 10], cost=network2.CrossEntropyCost) |
| 45 | +# net.large_weight_initializer() |
| 46 | +# net.SGD(training_data[:1000], 400, 10, 0.5, evaluation_data=test_data, |
| 47 | +# monitor_evaluation_accuracy=True, |
| 48 | +# monitor_training_cost=True) |
| 49 | + |
38 | 50 |
|
39 | 51 | # ----------------------
|
40 | 52 | # - network3.py example:
|
|
0 commit comments