3 ms·
Elegant. I want to review this more. Could __slots__ work here? I always compulsively try that to save memory. Keep it up.
by bionhoward 3y ago
Elegant. I want to review this more. Could __slots__ work here? I always compulsively try that to save memory. Keep it up.
- noway421 3y agoGreat idea! I'm testing it on a 3-layer perceptron, so memory is less of an issue, but __slots__ seems to speed up the training time by 5%! Pushed the implementation to a branch: https://github.com/noway/yagrad/blob/slots/train.py https://github.com/noway/yagrad/blob/slots/train.py Unfortunately it extends the line count past 100 lines, so I'll keep it separate from `main`. I have my email address on my website (which is in my bio) - don't hesitate to reach out. Cheers!