In December 2025, over my winter break from college, I completed Andrej Karpathy's Zero to Hero lecture series on machine learning. At college we were studying Java as our main language and, in order to practice it more efficiently, I decided to port one of Karpathy's libraries to Java.
Micrograd was the obvious choice for this, as it did not rely on any Python libraries such as PyTorch and was also extremely object-oriented. Micrograd is a simple autograd engine that allows you to train small multilayer perceptrons. It includes logic for calculating gradients for different layers during the backward pass and optimising for a loss function during the forward pass.
Overall, porting Micrograd to Java probably sounds much more impressive than it actually was. It still taught me a lot about object-oriented programming and helped me a lot with my module in school. It also gave me experience making the project installable with Maven, which is something we surprisingly never touched on in class.