NeuralCPP is a Neural Network Library written in C++. It offers a simple API to create and train neural networks.
To add NeuralCPP to your project, follow these steps:
- Add NeuralCPP as a submodule to your project:
git submodule add -b main https://github.com/B-Manitas/NeuralCPP.git
git submodule update --init --recursive
-
Include the
NeuralCPP/include/NeuralCPP.hpp
file in your project. -
Compile your project with the following flags:
-std=c++11 -fopenmp
#include "include/NeuralCPP.hpp"
int main()
{
// Create the dataset
cmatrix<float> X, y;
NeuralCPP::create_dataset(X, y, 100000, 2, 2);
// Create the neural network model (2 hidden layers with 32 neurons each)
NeuralLayers nn({32, 32});
// Train the model
nn.fit(X, y, 10000, .01, true);
// Predict the output
cmatrix<cbool> y_pred = nn.predict(X);
return 0;
}
NeuralCPP is structured as follows:
Class | Description |
---|---|
include | |
NeuralCPP.hpp |
Includes all the other headers. |
NeuralLoss.hpp |
Defines the loss functions. |
NeuralActivation.hpp |
Defines the activation functions. |
NeuralPerceptron.hpp |
The Perceptron model. |
src | |
This folder contains the implementation of the library. |
For detailed information on how to use CMatrix, consult the documentation.
- CMatrix: A C++ library for matrix operations. (Required for compile CMatrix)
- OpenMP: An API for parallel programming. (Required for compile CMatrix)
- Doxygen: A documentation generator.
- Matplot++: A C++ Graphics Library for Data Visualization.
- CMatrix: A C++ library for matrix operations.
- CDataFrame: A C++ DataFrame library for Data Science and Machine Learning projects.
This project is licensed under the MIT License, ensuring its free and open availability to the community.