Brainet is a deep learning engine developed in C++, without relying on external libraries. Its primary goal is to offer a transparent framework that allows users to fully understand the underlying mechanisms. Unlike alternatives such as TensorFlow, PyTorch, or Caffe, which often feel like black boxes due to their high level of abstraction, Brainet wants to focus on explaining how everything works under the hood.
Currently, the best place to start is the example.cpp file, which can be found in the tests folder. This file contains an example of how to train a 2-layer Neural Network on the MNIST dataset.
The following image shows a high-level overview of the Brainet architecture:
-
Model Test Error Rate Training Time 2-layer NN, 300 hidden units, cross-entopy 5.9% 8 min
You'll need a C++ compiler that supports at least C++20. I recommend using the GNU Compiler Collection. (And git to download the source code.) For easy compilation, you can use CMake.
To download, run the following command in your terminal:
git clone https://github.com/Neurologism/brainetTo use Brainet, you need to include the Brainet header file in your project.
#include "brainet.h"An example of how to train a 2-layer Neural Network on the MNIST dataset can be found in the example.cpp file.
To compile the example file, navigate to the build folder and run the following command in your terminal:
cmake --build ./To run the compiled file, navigate to the bin folder and run the following command in your terminal:
./exampleThe only dataset that comes with Brainet is the MNIST dataset. The following contains a list of download links for other datasets that can be used with Brainet:
To use them, you will also need a tool to extract gzip and tar files. I recommend using 7-Zip.
