Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/plasmacontrol/keras2c
A simple library to deploy Keras neural networks in pure C for realtime applications
https://github.com/plasmacontrol/keras2c
c control-systems convert-keras convert-tensorflow cpp keras keras-to-c machine-learning neural-network real-time tensorflow
Last synced: about 4 hours ago
JSON representation
A simple library to deploy Keras neural networks in pure C for realtime applications
- Host: GitHub
- URL: https://github.com/plasmacontrol/keras2c
- Owner: PlasmaControl
- License: lgpl-3.0
- Created: 2019-06-21T19:45:05.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-11-11T19:09:17.000Z (4 days ago)
- Last Synced: 2024-11-11T20:19:41.536Z (4 days ago)
- Topics: c, control-systems, convert-keras, convert-tensorflow, cpp, keras, keras-to-c, machine-learning, neural-network, real-time, tensorflow
- Language: C
- Homepage:
- Size: 7.25 MB
- Stars: 86
- Watchers: 5
- Forks: 33
- Open Issues: 11
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
#######
keras2c
#######|Build-Status| |Codecov|
|License| |DOI|
keras2c is a library for deploying keras neural networks in C99, using only standard libraries.
It is designed to be as simple as possible for real time applications.Quickstart
**********After cloning the repo, install the necessary packages with ``pip install -r requirements.txt``.
keras2c can be used from the command line:
.. code-block:: bash
python -m keras2c [-h] [-m] [-t] model_path function_name
A library for converting the forward pass (inference) part of a keras model to
a C functionpositional arguments:
model_path File path to saved keras .h5 model file
function_name What to name the resulting C function
optional arguments:
-h, --help show this help message and exit
-m, --malloc Use dynamic memory for large arrays. Weights will be
saved to .csv files that will be loaded at runtime
-t , --num_tests Number of tests to generate. Default is 10It can also be used with a python environment in the following manner:
.. code-block:: python
from keras2c import k2c
k2c(model, function_name, malloc=False, num_tests=10, verbose=True)For more information, see `Installation `_ and `Usage `_
Supported Layers
****************
- **Core Layers**: Dense, Activation, Dropout, Flatten, Input, Reshape, Permute, RepeatVector, ActivityRegularization, SpatialDropout1D, SpatialDropout2D, SpatialDropout3D
- **Convolution Layers**: Conv1D, Conv2D, Conv3D, Cropping1D, Cropping2D, Cropping3D, UpSampling1D, UpSampling2D, UpSampling3D, ZeroPadding1D, ZeroPadding2D, ZeroPadding3D
- **Pooling Layers**: MaxPooling1D, MaxPooling2D, AveragePooling1D, AveragePooling2D, GlobalMaxPooling1D, GlobalAveragePooling1D, GlobalMaxPooling2D, GlobalAveragePooling2D, GlobalMaxPooling3D,GlobalAveragePooling3D
- **Recurrent Layers**: SimpleRNN, GRU, LSTM, SimpleRNNCell, GRUCell, LSTMCell
- **Embedding Layers**: Embedding
- **Merge Layers**: Add, Subtract, Multiply, Average, Maximum, Minimum, Concatenate, Dot
- **Advanced Activation Layers**: LeakyReLU, PReLU, ELU, ThresholdedReLU, Softmax, ReLU
- **Normalization Layers**: BatchNormalization
- **Noise Layers**: GaussianNoise, GaussianDropout, AlphaDropout
- **Layer Wrappers**: TimeDistributed, Bidirectional
ToDo
****
- **Core Layers**: Lambda, Masking
- **Convolution Layers**: SeparableConv1D, SeparableConv2D, DepthwiseConv2D, Conv2DTranspose, Conv3DTranspose
- **Pooling Layers**: MaxPooling3D, AveragePooling3D
- **Locally Connected Layers**: LocallyConnected1D, LocallyConnected2D
- **Recurrent Layers**: ConvLSTM2D, ConvLSTM2DCell
- **Merge Layers**: Broadcasting merge between different sizes
- **Misc**: models made from submodelsContribute
**********- Documentation: ``_
- Issue Tracker: ``_
- Source Code: ``_
License
*******The project is licensed under the LGPLv3 license.
.. |Build-Status| image:: https://travis-ci.org/f0uriest/keras2c.svg?branch=master
:target: https://travis-ci.org/f0uriest/keras2c
:alt: Build Status
.. |Codecov| image:: https://codecov.io/gh/f0uriest/keras2c/branch/master/graph/badge.svg
:target: https://codecov.io/gh/f0uriest/keras2c
:alt: Code Coverage
.. |License| image:: https://img.shields.io/github/license/f0uriest/keras2c
:target: https://github.com/f0uriest/keras2c/blob/master/LICENSE
:alt: License: LGPLv3
.. |DOI| image:: https://zenodo.org/badge/193152058.svg
:target: https://zenodo.org/badge/latestdoi/193152058
:alt: Please Cite Keras2c!