Shape Utilities
Implement the small helper functions for working with shape tuples and index ordering that the rest of the engine relies on.
Construct a lazy buffer, reverse-mode autodiff engine, tensor API, neural primitives, and train a small MLP.
Every source step is its own lesson with intuition, concepts, correctly rendered MathJax mathematics, implementation, tests, mistakes, and a checkpoint.
Implement the small helper functions for working with shape tuples and index ordering that the rest of the engine relies on.
Build the numpy-backed LazyBuffer with constant and random initialization plus elementwise, reduce, and movement operations.
Define the differentiable Function base class and implement forward and backward passes for all unary, binary, reduce, and movement operations.
Create the Tensor wrapper, creation helpers, topological backward pass, and method bindings for every supported operation.
Compose primitives into higher-level operations like mean, matmul, softmax, log_softmax, and cross entropy.
Implement Linear layers, an MLP, and the SGD optimizer with gradient zeroing.
Generate a toy dataset, train the MLP end to end, and evaluate its accuracy on a held-out split.