From a055180afa61ef4f52f085f67ffa877f7b79fe26 Mon Sep 17 00:00:00 2001 From: Nathaniel Chen <79379842+nathanchenseanwalter@users.noreply.github.com> Date: Sat, 27 Dec 2025 06:11:12 -0800 Subject: [PATCH] Revise README with installation and usage details Updated README to include installation instructions and clarify usage. --- README.rst | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/README.rst b/README.rst index 1bf2d6c..d7f76bb 100644 --- a/README.rst +++ b/README.rst @@ -2,18 +2,11 @@ keras2c ####### -|Python-Publish| |Python-Versions| |Codecov| +|Python-Publish| |Python-Versions| |Codecov| |License| |DOI| -IMPORTANT: Keras2C has started updating to be compatible with newer versions of Python on July 9th, 2025. Changes may be breaking. To use the original/stable version, use the Release v1.0.2. https://github.com/PlasmaControl/keras2c/releases/tag/v1.0.2 with the command - -.. code-block:: bash - - git clone git@github.com:PlasmaControl/keras2c.git --branch v1.0.2 - -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. +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. Please cite `this paper `_ if you use this work in your research: @@ -22,13 +15,27 @@ Please cite `this paper `_ if yo R. Conlin, K. Erickson, J. Abbate, and E. Kolemen, “Keras2c: A library for converting Keras neural networks to real-time compatible C,” Engineering Applications of Artificial Intelligence, vol. 100, p. 104182, Apr. 2021, doi: 10.1016/j.engappai.2021.104182. -Quickstart -********** +Installation +************ + +**Recommended Installation** + +The modern way to install keras2c is via pip: + +.. code-block:: bash -For windows, make sure that you have gcc installed. We recommend CYGWIN with make and gcc + pip install keras2c -After cloning the repo, install the necessary packages with ``pip install -r requirements.txt``. -Alternatively, create a conda environment using ``conda env create -f environment.yml``. +To use the original/stable version, use the Release v1.0.2 (https://github.com/PlasmaControl/keras2c/releases/tag/v1.0.2) with the command: + +.. code-block:: bash + + git clone git@github.com:PlasmaControl/keras2c.git --branch v1.0.2 + +For Windows, make sure that you have **gcc** installed. We recommend **CYGWIN** with make and gcc. + +Quickstart +********** keras2c can be used from the command line: @@ -50,21 +57,21 @@ keras2c can be used from the command line: -t , --num_tests Number of tests to generate. Default is 10 -It can also be used with a python environment in the following manner: +It can also be used within a python environment: .. 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 `_ +For more information, see `Installation `_ and `Usage `_ Supported Layers **************** -- **Core Layers**: Dense, Activation, Dropout, Flatten, Input, Reshape, Permute, RepeatVector, ActivityRegularization, SpatialDropout1D, SpatialDropout2D, SpatialDropout3D +- **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 +- **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 @@ -83,8 +90,6 @@ ToDo - **Merge Layers**: Broadcasting merge between different sizes - **Misc**: models made from submodels - - Contribute ********** @@ -97,7 +102,6 @@ License The project is licensed under the LGPLv3 license. - .. |Codecov| image:: https://codecov.io/gh/f0uriest/keras2c/branch/master/graph/badge.svg :target: https://codecov.io/gh/f0uriest/keras2c :alt: Code Coverage