Karpathy's scalar micrograd in Ziglang
  • Zig 96.1%
  • Nix 3.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-06-09 20:56:26 +03:00
src feat: MNIST 2026-06-09 20:56:26 +03:00
.envrc Initial commit 2026-06-09 18:02:41 +03:00
.gitignore Initial commit 2026-06-09 18:02:41 +03:00
build.zig feat: MNIST 2026-06-09 20:56:26 +03:00
build.zig.zon Initial commit 2026-06-09 18:02:41 +03:00
default.nix Initial commit 2026-06-09 18:02:41 +03:00
flake.lock Initial commit 2026-06-09 18:02:41 +03:00
flake.nix Initial commit 2026-06-09 18:02:41 +03:00
README.md feat: implement nn 2026-06-09 19:59:58 +03:00

micrograd.zig

Implementing Karpathy's micrograd with some help from 0xdeb7ef/microgradz.

Scalar only implementation, the nn.zig module implements Neuron, Layer and MLP to have comptime-known shapes, only the engine.zig module needs runtime-allocated memory.

Setup

Allow direnv

direnv allow

Build

zig build