Skip to content

Repository files navigation

Minimal Neural Network From Scratch in C++

Small MLP implemented with nothing but C++ STL. It was a fun opportunity to practice C++ and work with backprop math directly.

Build & Run

make run

By default, make run trains on the UCI seeds dataset in this repo. Tweak hyperparams in main.cpp.

What it has

  • Fully connected MLP and forward and backprop written by hand
  • Only using the C++ STL: std::vector, std::map, std::regex (for CSV ingest), <cmath>, <random>, etc. No third-party dependencies like Eigen or BLAS
  • Simple SGD training loop

Result

On the included dataset: ~94% accuracy with 8 hidden units, 600 epochs, LR=0.2.

Training Output

About

Minimal MLP implementation from scratch with STL

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages