karpathy/micrograd ? reverse-engineered prompt
Reverse engineered prompt
Build me a tiny Python library that can do automatic differentiation for scalar values, then use it to make a small neural net toolkit on top of it.
I want to be able to create values, combine them with normal math like add, multiply, power, division, and relu, then call backward to get gradients through the whole computation graph. Please make the API feel simple and friendly, kind of like PyTorch for basic use, and include a small neural network module with things like neurons, layers, and an MLP that can be trained with gradient descent.
Also include a couple of examples or notebooks that show how to train a simple binary classifier on a toy dataset and how to visualize the computation graph. Add tests that check the gradients are correct, and if you need to, look up current docs online for anything tricky. Keep it tiny, clean, and educational, like something someone could read and understand end to end.
Are you gonna build this?
make sure you review the code using coderabbit