# Micrograd.jl - a port of Andrej Karpathy's Micrograd to Julia

**URL:** https://discourse.julialang.org/t/micrograd-jl-a-port-of-andrej-karpathys-micrograd-to-julia/95779
**Category:** General Usage
**Tags:** machine-learning, neural-network
**Created:** [March 9, 2023, 3:11am UTC](https://discourse.julialang.org/t/micrograd-jl-a-port-of-andrej-karpathys-micrograd-to-julia/95779 "2023-03-09T03:11:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ajloza](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ajloza/32/47519_2.png) [@ajloza](https://discourse.julialang.org/u/ajloza)
#### Post date: [March 9, 2023, 3:11am UTC](https://discourse.julialang.org/t/micrograd-jl-a-port-of-andrej-karpathys-micrograd-to-julia/95779/1 "2023-03-09T03:11:09Z")

</div>

Andrej Karpathy has a great walkthrough of building a scalar reverse mode autodiff library and minimal neural network ([GitHub - karpathy/micrograd: A tiny scalar-valued autograd engine and a neural net library on top of it with PyTorch-like API](https://github.com/karpathy/micrograd)). This is a port to Julia with zero dependencies:

> **[GitHub - ajloza/Micrograd.jl](https://github.com/ajloza/Micrograd.jl)**
>
> Contribute to ajloza/Micrograd.jl development by creating an account on GitHub.

The meat of it is ~150 + ~170 lines of code for the autodiff and nn components, so it’s highly explorable. I don’t have an excellent video like Andrej’s to go with it but there are two minimal juptyer notebooks.

I made this mostly for myself and teaching purposes locally, but thought I’d share in case anyone else may find this useful.

Things it’s not:

- performant
- the best julian style code
