Starting w/ Karpathy's micrograd implementation, with plans to expand for performance and features.
Initial check-in is based on Karpathy's micrograd, but with performance improvements cutting run-time in half.
The commit details below.
Refactoring of names and organization.
The following performance optimizations were made based off profiling by cprofilev
Original profiled time on my computer: 111.7 seconds.
- pushed generator expression in loss, cut 6 seconds off run-time (105 seconds, 11.38 for sum)
- changed Value class to use slots, cut 6 more seconds, (98 seconds)
(tried a few things that had no performance value: lamda:None → a static method, localized variables from self)- removed the set initializer in constructor, cut 10 seconds! (86 seconds)
- using None (w/ a null check later) instead of Lambda: None, cut 3 seconds (83.5 seconds)
using np.multiply added 20 seconds :-Oconverting other objects to slots (no tangible benefit)- using currying (partial) cut 15 seconds off (68.8 seconds)
- pushed build_topo to the top, cut 3.3 seconds (65.5 seconds)