Projects · University

Neural Network from scratch

Stable 2025 Author

A feed-forward neural network in C++23 with no ML libraries, trained on UCI Car Evaluation and MNIST. Submitted as my algorithms and data structures final project.

Forward pass, backpropagation and training loop written by hand, with sigmoid, ReLU, leaky ReLU and tanh activations and a binary cross-entropy loss. A numerical gradient check runs through CTest.

  • Car Evaluation (UCI): 1,728 samples, six categorical attributes one-hot encoded into 21 inputs, four classes. Trains to about 100% test accuracy quickly.
  • MNIST handwritten digits from CSV, with the training and test files loaded on two threads at once.
  • Synthetic data whose target is the index of the largest input, useful for smoke-testing a topology without anything on disk.

Trained weights are written to disk as binary files.