Naive neural network to recognize MNIST handwritten images, no dependencies (except rand
instead of reading from /dev/random
), ~80% accuracy.
- No matrix -> Less abstraction, easier to understand ??
- Reuse memory when possible -> Better performance ??
- Parallel -> Better performance ??
- Every other example chooses matrix for REASONS! Operation like
transpose
helps a lot (for getting rid ofi,j,k
). Avoiding matrix affects readability indeed. Iter
with references in idiomatic Rust; LessCopy
more&mut
. But helps a little, sinceInstruments
showed that it has more pressure on CPU than on memory.- Not helpful either. (Tried
par_iter
inNeuron::z()
, got slower.) Because there always has to be SEQUENTIAL: forward after forward, backprop after backprop, iteration after iteration. It would be beneficial with more params (much slowerNeuron::z()
), like 70B? IDK