Skip to content

ocskiurity/initiator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

🗡️ initiator 🗡️

A collection of utilities to train and quantize 1-layer MLP weights and input data.

Getting started

Important: make sure anaconda or miniconda is installed in your system.

Create a conda environment with Python 3.9+ and install the required dependencies:

conda create --prefix=./venv python=3.9
conda activate ./venv
pip install -r requirements.txt

We provide two scripts to bootstrap the training and quantization of both model weights and input data.

  1. First, we will train a lightweight 1-layer MLP on the Breast Cancer Wisconsin dataset with:
./scripts/train.sh

After training is finished, a checkpoint will be saved at checkpoint/MLP.json.

  1. Then, we will export the trained model to .onnx, perform static uint8 quantization with calibration and save both quantized model weights/bias and data input with:
./scripts/quantize.sh

After quantization is finished, you will find three new .onnx files in the checkpoint directory:

  • MLP.onnx: this is the onnx exported model
  • MLP_quant_preproc.onnx: this is the preprocessed onnx model prior to quantization
  • MLP_quant.onnx: this is the statically quantized model

Additionally, two .json files with quantized model weights/bias and data input are saved to data/json/model.json and data/json/quantizedData.json, respectively.

About

a collection of utilities to train and quantize 1-layer MLP weights and input data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published