# tiny-dnn/tiny-dnn

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/tiny-dnn-tiny-dnn).**

6,019 stars · 1,391 forks · C++ · NOASSERTION

## Links

- GitHub: https://github.com/tiny-dnn/tiny-dnn
- Homepage: http://tiny-dnn.readthedocs.io
- awesome-repositories: https://awesome-repositories.com/repository/tiny-dnn-tiny-dnn.md

## Description

tiny-dnn is a header-only C++14 deep learning framework for building, training, and running inference on neural networks. It constructs static computational graphs at compile time using template-based layer composition, with a gradient-based backpropagation engine and minibatch stochastic gradient descent for training, all without external dependencies beyond the C++14 standard library.

The framework supports importing pre-trained models from the Caffe framework directly, parsing its binary serialization format without requiring external protocol buffer libraries. It provides CPU-optimized tensor operations for both training and inference, with file-based weight serialization for saving and restoring network parameters.

The library includes support for constructing networks by composing layers such as fully-connected, convolutional, and pooling in a sequential pipeline, with built-in support for training on the MNIST dataset. It offers configurable optimization algorithms, loss functions, and activation functions, and allows extending the network with custom layer types through a defined interface.

## Tags

### Data & Databases

- [Deep Learning Frameworks](https://awesome-repositories.com/f/data-databases/data-processing-pipelines/data-serialization/json-libraries/c/header-only-libraries/deep-learning-frameworks.md) — Provides a header-only C++14 deep learning framework with no external dependencies.

### Artificial Intelligence & ML

- [Backpropagation Training Loops](https://awesome-repositories.com/f/artificial-intelligence-ml/backpropagation-training-loops.md) — Adjusts network weights using backpropagation and gradient descent on labeled training data. ([source](http://tiny-dnn.readthedocs.io/getting_started/Getting-started.html))
- [Static Graph Builders](https://awesome-repositories.com/f/artificial-intelligence-ml/computational-graphs/static-graph-builders.md) — Builds the entire network topology at construction time as a fixed directed acyclic graph with no runtime graph mutation.
- [Binary Parsers](https://awesome-repositories.com/f/artificial-intelligence-ml/computer-vision-models/model-deployment/caffe-framework-implementations/binary-parsers.md) — Provides direct binary parsing of Caffe model files without external protocol buffer dependencies.
- [CPU-Optimized Training](https://awesome-repositories.com/f/artificial-intelligence-ml/custom-model-training/detection-model-training/convolutional-neural-network-training/cpu-optimized-training.md) — Trains feedforward and convolutional networks on CPU using minibatch SGD with configurable optimizers.
- [Header-Only Implementations](https://awesome-repositories.com/f/artificial-intelligence-ml/deep-learning-framework-implementations/header-only-implementations.md) — Provides a header-only C++14 deep learning framework with no external dependencies.
- [Automatic Differentiation Engines](https://awesome-repositories.com/f/artificial-intelligence-ml/gradient-computation/backpropagation-through-time/automatic-differentiation-engines.md) — Implements automatic differentiation through a computational graph for gradient-based backpropagation.
- [Inference Execution](https://awesome-repositories.com/f/artificial-intelligence-ml/inference-execution.md) — Feeds input data through a trained network to produce predictions or classifications. ([source](http://tiny-dnn.readthedocs.io/getting_started/Getting-started.html))
- [Training Workflows](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning-guides/study-guides/mnist-dataset-studies/training-workflows.md) — Provides built-in support for training networks on the MNIST dataset with configurable epochs and minibatch size.
- [Model Inference](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-inference-serving/model-integration-pipelines/model-inference.md) — Feeds input data through a completed network to produce predictions or classifications. ([source](http://tiny-dnn.readthedocs.io/))
- [Template-Based Compositions](https://awesome-repositories.com/f/artificial-intelligence-ml/model-composition-architectures/hybrid-layer-compositions/modular-layer-compositions/template-based-compositions.md) — Composes network layers as C++ template classes at compile time for zero-cost abstraction.
- [Minibatch Training Utilities](https://awesome-repositories.com/f/artificial-intelligence-ml/model-training-optimizers/minibatch-training-utilities.md) — Trains networks by processing small random subsets of training data per iteration with configurable learning rate and momentum.
- [Neural Network Composition](https://awesome-repositories.com/f/artificial-intelligence-ml/neural-network-composition.md) — Constructs a deep learning model by composing layers in C++ without external dependencies or separate compilation steps. ([source](https://cdn.jsdelivr.net/gh/tiny-dnn/tiny-dnn@main/README.md))
- [Sequential Model Builders](https://awesome-repositories.com/f/artificial-intelligence-ml/neural-network-construction/sequential-model-builders.md) — Assembles a network by stacking layers such as convolution, pooling, and fully-connected in a sequential pipeline. ([source](https://cdn.jsdelivr.net/gh/tiny-dnn/tiny-dnn@main/README.md))
- [Configurable Training Loops](https://awesome-repositories.com/f/artificial-intelligence-ml/neural-training-pipelines/training-execution-loops/configurable-training-loops.md) — Runs a training loop with a chosen optimizer and loss function over labeled data for a specified number of epochs and minibatch size. ([source](https://cdn.jsdelivr.net/gh/tiny-dnn/tiny-dnn@main/README.md))
- [Stochastic Gradient Descent](https://awesome-repositories.com/f/artificial-intelligence-ml/stochastic-gradient-descent.md) — Trains networks using minibatch stochastic gradient descent with configurable learning rate and momentum.
- [Weight Serialization](https://awesome-repositories.com/f/artificial-intelligence-ml/weight-reconstruction/weight-serialization.md) — Saves and loads model parameters as flat binary files for fast storage and retrieval.
- [Activation Functions](https://awesome-repositories.com/f/artificial-intelligence-ml/activation-functions/gated-linear-units/activation-functions.md) — Applies a non-linear transformation like ReLU, sigmoid, or tanh to a layer's output to introduce non-linearity. ([source](https://cdn.jsdelivr.net/gh/tiny-dnn/tiny-dnn@main/README.md))
- [Model Importers](https://awesome-repositories.com/f/artificial-intelligence-ml/computer-vision-models/model-deployment/caffe-framework-implementations/model-importers.md) — Loads a pre-trained network definition and weights from the Caffe framework for inference or fine-tuning. ([source](http://tiny-dnn.readthedocs.io/))
- [Custom Neural Network Layers](https://awesome-repositories.com/f/artificial-intelligence-ml/custom-neural-network-layers.md) — Implements forward and backward propagation functions to introduce a new layer type into a neural network. ([source](http://tiny-dnn.readthedocs.io/developer_guides/Adding-a-new-layer.html))
- [Image Classification](https://awesome-repositories.com/f/artificial-intelligence-ml/image-classification.md) — Applies a trained convolutional neural network to recognize objects in image datasets such as MNIST or Cifar-10. ([source](http://tiny-dnn.readthedocs.io/))
- [MNIST Dataset Studies](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning-guides/study-guides/mnist-dataset-studies.md) — Trains and evaluates convolutional networks on the MNIST dataset for handwritten digit classification.
- [Custom Layer Implementations](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/architectures/neural-network-components/custom-layer-implementations.md) — Extends the set of available neural network operations by implementing a new layer type through a defined interface. ([source](http://tiny-dnn.readthedocs.io/))
- [Weight Persistence](https://awesome-repositories.com/f/artificial-intelligence-ml/model-weight-management/weight-transformations/weight-persistence.md) — Persists trained network parameters to a file and restores them later for inference or continued training. ([source](https://cdn.jsdelivr.net/gh/tiny-dnn/tiny-dnn@main/README.md))
- [Loss Function Selections](https://awesome-repositories.com/f/artificial-intelligence-ml/prediction-visualization/loss-function-calculators/binary-cross-entropy-calculators/cross-entropy-loss-functions/loss-function-selections.md) — Measures the difference between predicted and target values using cross-entropy, mean squared error, or mean absolute error. ([source](https://cdn.jsdelivr.net/gh/tiny-dnn/tiny-dnn@main/README.md))
- [Optimizer Selections](https://awesome-repositories.com/f/artificial-intelligence-ml/rmsprop-optimizers/optimizer-selections.md) — Updates network weights during training using SGD, Adagrad, RMSprop, or Adam to minimize the loss. ([source](https://cdn.jsdelivr.net/gh/tiny-dnn/tiny-dnn@main/README.md))
- [Layer Construction](https://awesome-repositories.com/f/artificial-intelligence-ml/transformer-architectures/layer-construction.md) — Constructs a single neural network layer, such as a fully-connected or convolutional layer, to process data. ([source](http://tiny-dnn.readthedocs.io/layers/Layers.html))

### Part of an Awesome List

- [Header-Only Implementations](https://awesome-repositories.com/f/awesome-lists/ai/machine-learning-toolkits/header-only-implementations.md) — Provides a dependency-free, header-only machine learning toolkit for constructing and training neural networks.
- [C++ Implementations](https://awesome-repositories.com/f/awesome-lists/ai/neural-network-libraries/c-implementations.md) — Provides a C++14 header-only library for building, training, and running inference on neural networks.
- [CPU-Optimized Implementations](https://awesome-repositories.com/f/awesome-lists/ai/neural-network-libraries/cpu-optimized-implementations.md) — Provides a CPU-optimized C++14 library for building, training, and running inference on neural networks.
- [Cache-Friendly Tensor Operations](https://awesome-repositories.com/f/awesome-lists/devtools/gpu-acceleration/deep-learning-acceleration/arm-cpu-tensor-operations/cache-friendly-tensor-operations.md) — Implements CPU-optimized tensor operations with cache-friendly memory layouts and loop unrolling.
- [AI & Machine Learning](https://awesome-repositories.com/f/awesome-lists/ai/ai-machine-learning.md) — Header-only deep learning framework
- [Artificial Intelligence](https://awesome-repositories.com/f/awesome-lists/ai/artificial-intelligence.md) — Header-only, dependency-free deep learning framework.
- [Machine Learning](https://awesome-repositories.com/f/awesome-lists/ai/machine-learning.md) — Dependency-free deep learning framework for C++14.
- [Machine Learning and AI](https://awesome-repositories.com/f/awesome-lists/ai/machine-learning-and-ai.md) — Header-only deep learning framework with no dependencies.
