{"id":13420086,"url":"https://github.com/tiny-dnn/tiny-dnn","last_synced_at":"2025-05-14T08:05:55.705Z","repository":{"id":5983514,"uuid":"7205740","full_name":"tiny-dnn/tiny-dnn","owner":"tiny-dnn","description":"header only, dependency-free deep learning framework in C++14","archived":false,"fork":false,"pushed_at":"2022-04-17T02:48:05.000Z","size":25554,"stargazers_count":5918,"open_issues_count":297,"forks_count":1384,"subscribers_count":334,"default_branch":"master","last_synced_at":"2025-05-03T15:02:21.420Z","etag":null,"topics":["c-plus-plus","deep-learning","machine-learning","neural-network"],"latest_commit_sha":null,"homepage":"http://tiny-dnn.readthedocs.io","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiny-dnn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-17T14:08:06.000Z","updated_at":"2025-04-30T07:12:19.000Z","dependencies_parsed_at":"2022-07-12T18:24:00.162Z","dependency_job_id":null,"html_url":"https://github.com/tiny-dnn/tiny-dnn","commit_stats":null,"previous_names":["nyanp/tiny-cnn"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiny-dnn%2Ftiny-dnn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiny-dnn%2Ftiny-dnn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiny-dnn%2Ftiny-dnn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiny-dnn%2Ftiny-dnn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiny-dnn","download_url":"https://codeload.github.com/tiny-dnn/tiny-dnn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254101615,"owners_count":22014909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","deep-learning","machine-learning","neural-network"],"created_at":"2024-07-30T22:01:26.001Z","updated_at":"2025-05-14T08:05:50.696Z","avatar_url":"https://github.com/tiny-dnn.png","language":"C++","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/tiny-dnn/tiny-dnn/blob/master/docs/logo/TinyDNN-logo-letters-alpha-version.png\"\u003e\u003cbr\u003e\u003cbr\u003e\n\u003c/div\u003e\n\n-----------------\n\n[![Maintainers Wanted](https://img.shields.io/badge/maintainers-wanted-red.svg)](https://github.com/pickhardt/maintainers-wanted)\n\n## The project may be abandoned since the maintainer(s) are just looking to move on. In the case anyone is interested in continuing the project, let us know so that we can discuss next steps.\n## Please visit: https://groups.google.com/forum/#!forum/tiny-dnn-dev\n\n-----------------\n\n[![Join the chat at https://gitter.im/tiny-dnn/users](https://badges.gitter.im/tiny-dnn/users.svg)](https://gitter.im/tiny-dnn/users) [![Docs](https://img.shields.io/badge/docs-latest-blue.svg)](http://tiny-dnn.readthedocs.io/) [![License](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg)](https://raw.githubusercontent.com/tiny-dnn/tiny-dnn/master/LICENSE) [![Coverage Status](https://coveralls.io/repos/github/tiny-dnn/tiny-dnn/badge.svg?branch=master)](https://coveralls.io/github/tiny-dnn/tiny-dnn?branch=master)\n\n**tiny-dnn** is a C++14 implementation of deep learning. It is suitable for deep learning on limited computational resource, embedded systems and IoT devices.\n\n| **`Linux/Mac OS`** | **`Windows`** |\n|------------------|-------------|\n|[![Build Status](https://travis-ci.org/tiny-dnn/tiny-dnn.svg?branch=master)](https://travis-ci.org/tiny-dnn/tiny-dnn)|[![Build status](https://ci.appveyor.com/api/projects/status/a5syoifm8ct7b4l2?svg=true)](https://ci.appveyor.com/project/tinydnn/tiny-dnn)|\n\n## Table of contents\n\n* [Features](#features)\n* [Comparison with other libraries](#comparison-with-other-libraries)\n* [Supported networks](#supported-networks)\n* [Dependencies](#dependencies)\n* [Build](#build)\n* [Examples](#examples)\n* [Contributing](#contributing)\n* [References](#references)\n* [License](#license)\n* [Gitter rooms](#gitter-rooms)\n\nCheck out the [documentation](http://tiny-dnn.readthedocs.io/) for more info.\n\n## What's New\n- 2016/11/30 [v1.0.0a3 is released!](https://github.com/tiny-dnn/tiny-dnn/tree/v1.0.0a3)\n- 2016/9/14 [tiny-dnn v1.0.0alpha is released!](https://github.com/tiny-dnn/tiny-dnn/releases/tag/v1.0.0a)\n- 2016/8/7  tiny-dnn is now moved to organization account, and renamed into tiny-dnn :)\n- 2016/7/27 [tiny-dnn v0.1.1 released!](https://github.com/tiny-dnn/tiny-dnn/releases/tag/v0.1.1)\n\n## Features\n- Reasonably fast, without GPU:\n    - With TBB threading and SSE/AVX vectorization.\n    - 98.8% accuracy on MNIST in 13 minutes training (@Core i7-3520M).\n- Portable \u0026 header-only:\n    - Runs anywhere as long as you have a compiler which supports C++14.\n    - Just include tiny_dnn.h and write your model in C++. There is nothing to install.\n- Easy to integrate with real applications:\n    - No output to stdout/stderr.\n    - A constant throughput (simple parallelization model, no garbage collection).\n    - Works without throwing an exception.\n    - [Can import caffe's model](https://github.com/tiny-dnn/tiny-dnn/tree/master/examples/caffe_converter).\n- Simply implemented:\n    - A good library for learning neural networks.\n\n## Comparison with other libraries\n\nPlease see [wiki page](https://github.com/tiny-dnn/tiny-dnn/wiki/Comparison-with-other-libraries).\n\n## Supported networks\n### layer-types\n- core\n    - fully connected\n    - dropout\n    - linear operation\n    - zero padding\n    - power\n- convolution\n    - convolutional\n    - average pooling\n    - max pooling\n    - deconvolutional\n    - average unpooling\n\t- max unpooling\n- normalization\n    - contrast normalization (only forward pass)\n    - batch normalization\n- split/merge\n    - concat\n    - slice\n    - elementwise-add\n\n### activation functions\n* tanh\n* asinh\n* sigmoid\n* softmax\n* softplus\n* softsign\n* rectified linear(relu)\n* leaky relu\n* identity\n* scaled tanh\n* exponential linear units(elu)\n* scaled exponential linear units (selu)\n\n### loss functions\n* cross-entropy\n* mean squared error\n* mean absolute error\n* mean absolute error with epsilon range\n\n### optimization algorithms\n* stochastic gradient descent (with/without L2 normalization)\n* momentum and Nesterov momentum\n* adagrad\n* rmsprop\n* adam\n* adamax\n\n## Dependencies\nNothing. All you need is a C++14 compiler (gcc 4.9+, clang 3.6+ or VS 2015+).\n\n## Build\ntiny-dnn is header-only, so *there's nothing to build*. If you want to execute sample program or unit tests, you need to install [cmake](https://cmake.org/) and type the following commands:\n\n```\ncmake . -DBUILD_EXAMPLES=ON\nmake\n```\n\nThen change to `examples` directory and run executable files.\n\nIf you would like to use IDE like Visual Studio or Xcode, you can also use cmake to generate corresponding files:\n\n```\ncmake . -G \"Xcode\"            # for Xcode users\ncmake . -G \"NMake Makefiles\"  # for Windows Visual Studio users\n```\n\nThen open .sln file in visual studio and build(on windows/msvc), or type ```make``` command(on linux/mac/windows-mingw).\n\nSome cmake options are available:\n\n|options|description|default|additional requirements to use|\n|-----|-----|----|----|\n|USE_TBB|Use [Intel TBB](https://www.threadingbuildingblocks.org/) for parallelization|OFF\u003csup\u003e1\u003c/sup\u003e|[Intel TBB](https://www.threadingbuildingblocks.org/)|\n|USE_OMP|Use OpenMP for parallelization|OFF\u003csup\u003e1\u003c/sup\u003e|[OpenMP Compiler](http://openmp.org/wp/openmp-compilers/)|\n|USE_SSE|Use Intel SSE instruction set|ON|Intel CPU which supports SSE|\n|USE_AVX|Use Intel AVX instruction set|ON|Intel CPU which supports AVX|\n|USE_AVX2|Build tiny-dnn with AVX2 library support|OFF|Intel CPU which supports AVX2|\n|USE_NNPACK|Use NNPACK for convolution operation|OFF|[Acceleration package for neural networks on multi-core CPUs](https://github.com/Maratyszcza/NNPACK)|\n|USE_OPENCL|Enable/Disable OpenCL support (experimental)|OFF|[The open standard for parallel programming of heterogeneous systems](https://www.khronos.org/opencl/)|\n|USE_LIBDNN|Use Greentea LibDNN for convolution operation with GPU via OpenCL (experimental)|OFF|[An universal convolution implementation supporting CUDA and OpenCL](https://github.com/naibaf7/libdnn)|\n|USE_SERIALIZER|Enable model serialization|ON\u003csup\u003e2\u003c/sup\u003e|-|\n|USE_DOUBLE|Use double precision computations instead of single precision|OFF|-|\n|USE_ASAN|Use Address Sanitizer|OFF|clang or gcc compiler|\n|USE_IMAGE_API|Enable Image API support|ON|-|\n|USE_GEMMLOWP|Enable gemmlowp support|OFF|-|\n|BUILD_TESTS|Build unit tests|OFF\u003csup\u003e3\u003c/sup\u003e|-|\n|BUILD_EXAMPLES|Build example projects|OFF|-|\n|BUILD_DOCS|Build documentation|OFF|[Doxygen](http://www.doxygen.org/)|\n|PROFILE|Build unit tests|OFF|gprof|\n\n\u003csup\u003e1\u003c/sup\u003e tiny-dnn use C++14 standard library for parallelization by default.\n\n\u003csup\u003e2\u003c/sup\u003e If you don't use serialization, you can switch off to speedup compilation time.\n\n\u003csup\u003e3\u003c/sup\u003e tiny-dnn uses [Google Test](https://github.com/google/googletest) as default framework to run unit tests. No pre-installation required, it's  automatically downloaded during CMake configuration.\n\nFor example, type the following commands if you want to use Intel TBB and build tests:\n```bash\ncmake -DUSE_TBB=ON -DBUILD_TESTS=ON .\n```\n\n## Customize configurations\nYou can edit include/config.h to customize default behavior.\n\n## Examples\nConstruct convolutional neural networks\n\n```cpp\n#include \"tiny_dnn/tiny_dnn.h\"\nusing namespace tiny_dnn;\nusing namespace tiny_dnn::activation;\nusing namespace tiny_dnn::layers;\n\nvoid construct_cnn() {\n    using namespace tiny_dnn;\n\n    network\u003csequential\u003e net;\n\n    // add layers\n    net \u003c\u003c conv(32, 32, 5, 1, 6) \u003c\u003c tanh()  // in:32x32x1, 5x5conv, 6fmaps\n        \u003c\u003c ave_pool(28, 28, 6, 2) \u003c\u003c tanh() // in:28x28x6, 2x2pooling\n        \u003c\u003c fc(14 * 14 * 6, 120) \u003c\u003c tanh()   // in:14x14x6, out:120\n        \u003c\u003c fc(120, 10);                     // in:120,     out:10\n\n    assert(net.in_data_size() == 32 * 32);\n    assert(net.out_data_size() == 10);\n\n    // load MNIST dataset\n    std::vector\u003clabel_t\u003e train_labels;\n    std::vector\u003cvec_t\u003e train_images;\n\n    parse_mnist_labels(\"train-labels.idx1-ubyte\", \u0026train_labels);\n    parse_mnist_images(\"train-images.idx3-ubyte\", \u0026train_images, -1.0, 1.0, 2, 2);\n\n    // declare optimization algorithm\n    adagrad optimizer;\n\n    // train (50-epoch, 30-minibatch)\n    net.train\u003cmse, adagrad\u003e(optimizer, train_images, train_labels, 30, 50);\n\n    // save\n    net.save(\"net\");\n\n    // load\n    // network\u003csequential\u003e net2;\n    // net2.load(\"net\");\n}\n```\nConstruct multi-layer perceptron (mlp)\n\n```cpp\n#include \"tiny_dnn/tiny_dnn.h\"\nusing namespace tiny_dnn;\nusing namespace tiny_dnn::activation;\nusing namespace tiny_dnn::layers;\n\nvoid construct_mlp() {\n    network\u003csequential\u003e net;\n\n    net \u003c\u003c fc(32 * 32, 300) \u003c\u003c sigmoid() \u003c\u003c fc(300, 10);\n\n    assert(net.in_data_size() == 32 * 32);\n    assert(net.out_data_size() == 10);\n}\n```\n\nAnother way to construct mlp\n\n```cpp\n#include \"tiny_dnn/tiny_dnn.h\"\nusing namespace tiny_dnn;\nusing namespace tiny_dnn::activation;\n\nvoid construct_mlp() {\n    auto mynet = make_mlp\u003ctanh\u003e({ 32 * 32, 300, 10 });\n\n    assert(mynet.in_data_size() == 32 * 32);\n    assert(mynet.out_data_size() == 10);\n}\n```\n\nFor more samples, read examples/main.cpp or [MNIST example](https://github.com/tiny-dnn/tiny-dnn/tree/master/examples/mnist) page.\n\n## Contributing\nSince deep learning community is rapidly growing, we'd love to get contributions from you to accelerate tiny-dnn development!\nFor a quick guide to contributing, take a look at the [Contribution Documents](CONTRIBUTING.md).\n\n## References\n[1] Y. Bengio, [Practical Recommendations for Gradient-Based Training of Deep Architectures.](http://arxiv.org/pdf/1206.5533v2.pdf)\n    arXiv:1206.5533v2, 2012\n\n[2] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner, [Gradient-based learning applied to document recognition.](http://yann.lecun.com/exdb/publis/pdf/lecun-01a.pdf)\n    Proceedings of the IEEE, 86, 2278-2324.\n\nOther useful reference lists:\n- [UFLDL Recommended Readings](http://deeplearning.stanford.edu/wiki/index.php/UFLDL_Recommended_Readings)\n- [deeplearning.net reading list](http://deeplearning.net/reading-list/)\n\n## License\nThe BSD 3-Clause License\n\n## Gitter rooms\nWe have gitter rooms for discussing new features \u0026 QA.\nFeel free to join us!\n\n\u003ctable\u003e\n\u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003e developers \u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003e https://gitter.im/tiny-dnn/developers \u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003e users \u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003e https://gitter.im/tiny-dnn/users \u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n","funding_links":[],"categories":["Toolbox","C++","TODO scan for Android support in followings","Artificial Intelligence","Neural Networks (NN) and Deep Neural Networks (DNN)","Uncategorized","Deep Learning Framework","Data Mining, Machine Learning, and Deep Learning","AI"],"sub_categories":["Libraries","NN/DNN Software Frameworks","Uncategorized","High-Level DL APIs"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiny-dnn%2Ftiny-dnn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiny-dnn%2Ftiny-dnn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiny-dnn%2Ftiny-dnn/lists"}