Ultra simplified "MNIST" in 60 lines of Python with NumPy(github.com)
github.com
Ultra simplified "MNIST" in 60 lines of Python with NumPy
https://github.com/tonio-m/python_neural_network
9 comments
Tinygrad offers a superior MNIST implementation with minimal dependencies[0].
[0] https://github.com/tinygrad/tinygrad/blob/master/docs/mnist....
[0] https://github.com/tinygrad/tinygrad/blob/master/docs/mnist....
Autograd hides the backward pass in that implementation, but this code spells it out explicitly.
[deleted]
The description: "no dependencies."
The first line: "import numpy as np"
The first line: "import numpy as np"
you got me, lol.
to be fair the only reason numpy is there is because truly
pure python doesn't have matmuls, and I didn't think reimplementing it wouldn't serve a didactic purpose.
A cool idea for a v2 without numpy would be implementing matmuls with lists, matrix transpose with zip() and switching np.exp for math.exp. And getting all that on fewer lines as possible.
A cool idea for a v2 without numpy would be implementing matmuls with lists, matrix transpose with zip() and switching np.exp for math.exp. And getting all that on fewer lines as possible.
[deleted]
[deleted]
https://iamtrask.github.io/2015/07/12/basic-python-network/