Backprop is a library for automatically differentiation mathematical expressions.
Add backprop.cpp as include in your project. Start by including the header file in your cmake file.
include_directories("path/to/backprop")
Then include the header file in your source file.
#include "backprop.h"
The following example demonstrates how to train a model to classify a binary dataset.
mkdir build
cd build
cmake ..
make
./and_example
mkdir build
cd build
cmake ..
make
./tests/test_main
The computational graph can be visualized using the write_dot
function, e.g.
write_dot("graph.dot", loss);
Using a linear regression example, this is the graph generated: