Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ora-io/keras2circom
python tool to transpile a tf.keras model into a circom circuit
https://github.com/ora-io/keras2circom
Last synced: 4 days ago
JSON representation
python tool to transpile a tf.keras model into a circom circuit
- Host: GitHub
- URL: https://github.com/ora-io/keras2circom
- Owner: ora-io
- License: mit
- Created: 2022-12-11T16:50:35.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-12T06:15:11.000Z (9 months ago)
- Last Synced: 2024-08-21T10:56:10.366Z (3 months ago)
- Language: Jupyter Notebook
- Homepage:
- Size: 292 KB
- Stars: 286
- Watchers: 32
- Forks: 53
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ora - zkML: keras2circom
README
# keras2circom
keras2circom is a python tool that transpiles a tf.keras model into a circom circuit.
## Installation
First, clone the repository:
```bash
git clone https://github.com/socathie/keras2circom.git
```Then, install the dependencies. You can use pip:
```bash
pip install -r requirements.txt
```If you use conda, you can also create a new environment with the following command:
```bash
conda env create -f environment.yml
```You will also need to install circom and snarkjs. You can run the following commands to install them:
```bash
bash setup-circom.sh
```Last but not least, run
```bash
npm install
```## Usage
To use the package, you can run the following command:
```bash
python main.py [-o ] [--raw]
```For example, to transpile the model in `models/model.h5` into a circom circuit, you can run:
```bash
python main.py models/model.h5
```The output will be in the `output` directory.
If you want to transpile the model into a circom circuit with "raw" output, i.e. no ArgMax at the end, you can run:
```bash
python main.py models/model.h5 --raw
```## Testing
To test the package, you can run the following command:
```bash
npm test
```