Straightforward Neural Network is an open source neural network library in C++20 optimized for CPU. The goal of this library is to make the use of neural networks as easy as possible.
See the full documentation here.
Dataset Name | Data type | Problem type | Score | Number of Parameters |
---|---|---|---|---|
Audio Cats and Dogs | audio | classification | 91.04% Accurracy | 382 |
Daily min temperatures | time series | regression | 1.42 Mean Absolute Error | 30 |
CIFAR-10 | image | classification | 61.77% Accurracy | 207210 |
Fashion-MNIST | image | classification | 89.65% Accurracy | 270926 |
MNIST | image | classification | 98.71% Accurracy | 261206 |
Wine | multivariate | classification | 100.0% Accurracy | 444 |
Iris | multivariate | classification | 100.0% Accurracy | 150 |
-
To compile open a command prompt and run
cmake -G"Unix Makefiles" ./.. && make
from thebuild
folder. -
To run the unit tests execute
./tests/unit_tests/UnitTests
frombuild
folder. -
To run the dataset tests run
./ImportDatasets.sh
and execute./tests/dataset_tests/DatasetTests
frombuild
folder.
-
You can generate a Visual Studio project by running
cmake -G"Visual Studio 17 2022" ./..
frombuild
folder. -
To run the unit tests open
./build/tests/unit_tests/UnitTests.vcxproj
in Visual Studio. -
To run the dataset tests run
./build/ImportDatasets.sh
and open./build/tests/dataset_tests/DatasetTests.vcxproj
in Visual Studio.
Create, train and use a neural network in few lines of code.
using namespace snn;
Data data(problem::classification, inputData, expectedOutputs);
StraightforwardNeuralNetwork neuralNetwork({
Input(1, 28, 28), // (C, X, Y)
Convolution(16, 3, activation::ReLU), // 16 filters and (3, 3) kernels
FullyConnected(92),
FullyConnected(10, activation::identity, Softmax())
});
neuralNetwork.train(data, 0.90_acc || 20_s); // Train neural network on data until 90% accuracy or 20s
float accuracy = neuralNetwork.getGlobalClusteringRate(); // Retrieve the accuracy