Genki ML Format

From ONNX and Keras

Models are exported using the genkiml CLI. The input is a model/checkpoint file and the output is the exported version of the model along with C++ code to run and easily integrate it in an existing codebase. This tool has support ONNX and Keras models

After installing the required packages run (see Installation CLI)

python path/to/model

This will output a zip archive to the desired --output-path. If no output path is provided the zip archive is put into the current folder.

Example using a Keras model

Let's define a simple fully connected network with an input with the shape (batch_size, 100) and 2 outputs and save it to disk

import tensorflow as tf

model = tf.keras.models.Sequential([
    tf.keras.layers.Dense(256, input_shape=(100,)),

Then simply point the genkiml CLI to the model.

python fully_connected_keras_model

This will output a file in the current folder,, that contains the exported model along with the runtime.

Cross-platform C++ Runtime