Loading...
Searching...
No Matches
OpenNN API Reference
OpenNN is a C++20 library for building, training and running neural networks, with CPU and optional CUDA execution. This is the API reference for OpenNN 26.0. For tutorials and guides, visit opennn.net.
The library is developed by Artelnics. The source code is at github.com/Artelnics/opennn.
Core classes
| Class | Role |
|---|---|
| TabularDataset, ImageDataset, TextDataset, YoloDataset | Data loading, sample roles, scaling and statistics |
| Network | Architecture and layers; ClassificationNetwork, ApproximationNetwork and ForecastingNetwork build common models |
| Training | Pairs a network and a dataset with a loss and an optimizer, and trains |
| Evaluation | Testing on held-out data: errors, confusion, ROC and other metrics |
| ModelSelection, InputSelection | Architecture and input search |
| ResponseOptimization | Finds inputs that optimize the outputs under constraints |
| ModelExpression | Exports a trained model as source code |
Layer types
Dense, Convolutional, Pooling, Pooling3d, LSTM, Recurrent, Embedding, MultiHeadAttention, Normalization3d, Scaling, Unscaling, Clamping, Addition, Flatten.
Optimizers
Adam, SGD, QuasiNewton (BFGS) and LevenbergMarquardt.
First program
This excerpt from the Iris example (examples/iris_plant/main.cpp) trains a classifier and evaluates it. The full example also exports the model:
#include "opennn/core/configuration.h"
#include "opennn/dataset/tabular_dataset.h"
#include "opennn/models/models.h"
#include "opennn/evaluation/evaluation.h"
#include "opennn/training/training.h"
using namespace opennn;
int main()
{
ClassificationNetwork network(dataset.get_input_shape(), {16}, dataset.get_target_shape());
Training training(&network, &dataset);
training.train();
Evaluation evaluation(&network, &dataset);
evaluation.print_multiple_classification_tests();
return 0;
}
Definition models.h:25
static Configuration & instance()
Definition evaluation.h:27
Definition tabular_dataset.h:18
Definition training.h:13
Definition configuration.h:10
Navigating the reference
- Class List: every class in alphabetical order.
- Class Index: alphabetical index by name.
- File List: by header file.
Resources
- Tutorials: https://www.opennn.net/tutorials/
- Building OpenNN: https://www.opennn.net/tutorials/building-opennn/
- Licensing options and commercial enquiries: https://www.opennn.net/licensing/
- License: GNU Affero General Public License, version 3 only, with the additional permissions in LICENSING.md, or a commercial license from Artelnics. OpenNN 8.x and earlier remain under the GNU LGPL 2.1 or later.
- Issues and contributions: https://github.com/Artelnics/opennn