Tiny from-scratch autograd + neural net playground in pure Python.
from AutoGrad import Value
a = Value(2.0)
b = Value(-3.0)
c = Value(10.0)
d = a * b
e = d + c
L = e.relu()
L.backward()
print("L:", L.value)
print("a.grad:", a.grad)
print("b.grad:", b.grad)
print("c.grad:", c.grad)This is the same learning flow as micrograd examples:
- build a tiny computation graph by hand
- call
backward()once on the final node - inspect gradients on leaf nodes
python3 optimizer.pyThat runs one small demo loop with:
NetworkfromNeuralNetwork.pyGD_Optimizerfromoptimizer.py- cross-entropy over integer labels