Beginner-friendly repo on how to Code a Simple Neural network with backprop in C++, bind it to python and train MNIST!
ReLu and Linear layers are implemented in C++ following PyTorch's naming convention. Some functionals like softmax are also implemented. The code is bound to python using pybind11. The model is trained on MNIST dataset using a python script.
- Download the data via
make download_mnist
. - Install the python dependencies via
pip install -r requirements.txt
. - Compile the C++ code via
make
. - Run the python script via
python train.py
. - (Optional) Compare against pytorch training via
python train_pytorch.py
.