Skip to content
/ mnist.c Public

MNIST classifier training in simple, raw C/CUDA. Inspired by llm.c

License

Notifications You must be signed in to change notification settings

Leikoe/mnist.c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mnist 99% from scratch in c (and hopefully cuda too)

Note: This code is heavily inspired by llm.c's, a lot of code was copied from there and modified.

How to use

python download_dataset.py  # downloads the mnist dataset to downloads/
clang train_mnist.c -o train_mnist  # run the traning

optionally compile with openmp support

# this is for apple silicon macs, "brew install libomp" if you don't already have it
clang -DOMP -Xclang -fopenmp -L/opt/homebrew/opt/libomp/lib -I/opt/homebrew/opt/libomp/include -lomp train_mnist.c -o train_mnist

About

MNIST classifier training in simple, raw C/CUDA. Inspired by llm.c

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published