Giter Club home page Giter Club logo

keras2c's Introduction

keras2c

Build Status Code Coverage

License: LGPLv3 Please Cite Keras2c!

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:

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 function

positional 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 10

It can also be used with a python environment in the following manner:

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 submodels

Contribute

License

The project is licensed under the LGPLv3 license.

keras2c's People

Contributors

f0uriest avatar roboticarm2000 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.