Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/orestonce/keras2go
keras2go 是一个可以把keras网络模型转换成纯go语言实现前向传播的工具
https://github.com/orestonce/keras2go
deeplearning golang keras pure-go
Last synced: 23 days ago
JSON representation
keras2go 是一个可以把keras网络模型转换成纯go语言实现前向传播的工具
- Host: GitHub
- URL: https://github.com/orestonce/keras2go
- Owner: orestonce
- License: mit
- Created: 2022-03-06T06:50:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-03-06T06:56:40.000Z (over 2 years ago)
- Last Synced: 2024-06-21T19:54:54.861Z (5 months ago)
- Topics: deeplearning, golang, keras, pure-go
- Language: Go
- Homepage:
- Size: 128 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
keras2go
====English | [中文](https://github.com/orestonce/keras2go/blob/master/README_zh.md)
* keras2go uses go code to re-implement the functionality of [keras2c](https://github.com/f0uriest/keras2c)
* keras2go is a library for deploying keras neural networks in pure go, 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``.
1. Clone the repo
2. install the necessary packages ``pip install -r requirements.txt``
3. Run the conversion tool to convert the .h5 model to the implementation of the go code, then run go test
````bash
cd conv_tool
python -m keras2go --num_tests 15 --model_path ./model.h5 --function_name Example --package_name example
go fmt *.go
go test -v .
````keras2go can be used from the command line:
````bash
python -m keras2go [-h] [--num_tests] 10 --model_path ./model.h5 --function_name Example2 --package_name exampleA library for converting the forward pass (inference) part of a keras model to a go function
arguments:
-t, --num_tests Number of tests to generate. Default is 10
-m, --model_path File path to saved keras .h5 model file
-f, --function_name What to name the resulting go function
-p, --package_name What to name the resulting go package
-h, --help show this help message and exit
````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
====
- test code
- 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 submodelsLicense
====
MITSimilar projects
====
I found another similar projects on Github:
* https://github.com/gosha20777/keras2cpp
* https://github.com/pplonski/keras2cpp
* https://github.com/moof2k/kerasify
* https://github.com/Dobiasd/frugally-deep