We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7283525 commit 092007fCopy full SHA for 092007f
1 file changed
test.py
@@ -1,9 +1,9 @@
1
"""
2
Testing code for different neural network configurations.
3
- Adapted for Python 3.4.3
+ Adapted for Python 3.5.2
4
5
Usage in shell:
6
- python3 test.py
+ python3.5 test.py
7
8
Network (network.py and network2.py) parameters:
9
2nd param is epochs count
@@ -64,12 +64,6 @@
64
monitor_training_accuracy=True)
65
'''
66
67
-net = network2.Network([784, 30, 10], cost=network2.CrossEntropyCost)
68
-net.SGD(training_data[:1000], 30, 10, 0.5,
69
- lmbda=5.0,
70
- evaluation_data=validation_data,
71
- monitor_evaluation_accuracy=True)
72
-
73
# chapter 3 - Early stopping implemented
74
75
net = network2.Network([784, 30, 10], cost=network2.CrossEntropyCost)
@@ -81,6 +75,16 @@
81
early_stopping_n=10)
82
76
83
77
78
+# chapter 4 - The vanishing gradient problem - deep networks are hard to train with simple SGD algorithm
79
+# this network learns much slower than a shallow one.
80
+net = network2.Network([784, 30, 30, 30, 30, 10], cost=network2.CrossEntropyCost)
+net.SGD(training_data, 30, 10, 0.1,
+ lmbda=5.0,
+ evaluation_data=validation_data,
84
+ monitor_evaluation_accuracy=True)
85
+
86
87
88
# ----------------------
89
# - network3.py example:
90
import network3
0 commit comments