Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LFC BNN-PYNQ examples #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added models/MNIST/Brevitas_FINN_LFC/LFC/LFC_1W1A.onnx
Binary file not shown.
Binary file added models/MNIST/Brevitas_FINN_LFC/LFC/LFC_1W2A.onnx
Binary file not shown.
23 changes: 23 additions & 0 deletions models/MNIST/Brevitas_FINN_LFC/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Brevitas QONNX Examples

This repo contains pretrained models in the Quantized ONNX format (QONNX). Originally used in the [BNN-PYNQ](https://github.com/Xilinx/BNN-PYNQ) repo
using [Brevitas](https://github.com/Xilinx/brevitas).

These pretrained models and training scripts (located in the [Brevitas Repo](https://github.com/Xilinx/brevitas/tree/master/src/brevitas_examples/bnn_pynq) are courtesy of
[Alessandro Pappalardo](https://github.com/volcacius) and [Ussama Zahid](https://github.com/ussamazahid96).

## Models

"LFC" models are "large" fully connected networks, similar to "TFC"/"SFC" models, with three hidden layers, each with 64 neurons.
More details about these models can be found in the [FINN: A Framework for Fast, Scalable Binarized Neural Network Inference](https://arxiv.org/abs/1612.07119) paper.

NOTE: Accuracy numbers listed here are taken from the Brevitas repo, and are not verified running through QONNX at this time.

| Name | Input quantization | Weight quantization | Activation quantization | Dataset | Top1 accuracy |
|----------|------------------------------|---------------------|-------------------------|---------------|---------------|
| LFC_1W1A | 1 bit | 1 bit | 1 bit | MNIST | 98.88% |
| LFC_1W2A | 2 bit | 1 bit | 2 bit | MNIST | 98.99% |

## Train

The training scripts for these models are located in the [Brevitas Repo](https://github.com/Xilinx/brevitas/tree/master/src/brevitas_examples/bnn_pynq).