Skip to content

Commit f29b8f5

Browse files
Rescale inputs.
1 parent 87cf988 commit f29b8f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/mnist_small.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test(net, test_data):
3030
print(i)
3131

3232
t = test_row[0]
33-
x = to_col(test_row[1:])
33+
x = to_col(test_row[1:])/255
3434
out = net.forward_pass(x)
3535
guess = np.argmax(out)
3636
if t == guess:
@@ -43,7 +43,7 @@ def train(net, train_data):
4343
if not i%1000:
4444
print(i)
4545

46-
net.train(to_col(train_row[1:]), train_row[0])
46+
net.train(to_col(train_row[1:])/255, train_row[0])
4747

4848

4949
if __name__ == "__main__":

0 commit comments

Comments
 (0)