The code in this repository was created to test the Zig programming language. It includes a small library for matrix multiplication and an implementation of a small perceptron neural network.
This code is tested and compiled with zig 0.14
The main can be run with different arguments to either train or visualize the neural networks results.
zig build run -Doptimize=ReleaseFast -- ml # training of the neural network. Expects the MNIST dataset at data/MNIST/
zig build run -Doptimize=ReleaseFast -- run_ml # uses mx1 and mx2 files as the weights for the two layers of the network. Visualizes the results of the ml with raylib
zig build run -Doptimize=ReleaseFast -- visualize # visualizes the MNIST dataset. Expects the MNIST dataset at data/MNIST/
zig build run -Doptimize=ReleaseFast -- mandelbrot # calculates mandelbrot image but no output yet- In idx.zig is code to read the MNIST idx dataset files
- The ml folder contains all the code for the neural network
- The dot.zig has multiple implementations for matrix multiplication. From a simple basic implementation to versions that are threaded and taking advantage of caching. The ml code uses this matrix library
- Some code to create a mandelbrot image