LLNN: A Scalable LUT-Based Logic Neural Network Architecture for FPGAs
Project description
LLNN: A Scalable LUT-Based Logic Neural Network Architecture for FPGAs
This repository implements Look-Up Tables Logic Neural Networks (LLNNs) presented in:
LLNN: A Scalable LUT-Based Logic Neural Network Architecture for FPGAs
📖 Citing
If you use this work, please cite the following paper:
@ARTICLE{11154450,
author={Ramírez, Iván and Garcia-Espinosa, Francisco J. and Concha, David and Aranda, Luis Alberto and Schiavi, Emanuele},
journal={IEEE Transactions on Circuits and Systems I: Regular Papers},
title={LLNN: A Scalable LUT-Based Logic Neural Network Architecture for FPGAs},
year={2025},
volume={},
number={},
pages={1-13},
keywords={Logic gates;Field programmable gate arrays;Biological neural networks;Table lookup;Hardware;Computer architecture;Training;Neurons;Logic;Complexity theory;Logic neural networks;LUT-based neural networks;FPGA implementation;scalability in hardware neural networks;real-time inference},
doi={10.1109/TCSI.2025.3606054}
}
Installation
pip install llnn
Importing LUTLayer
import torch
from llnn.lutlayer import LUTLayer, Aggregation
model = torch.nn.Sequential(
torch.nn.Flatten(),
LUTLayer(input_dim=1000, lut_size=6, n_luts=2048),
LUTLayer(input_dim=2048, lut_size=6, n_luts=4000),
Aggregation(num_classes=10, tau=10)
)
Train a model
python main.py --train --save --name model1 --dataset mnist --batch-size 128 -lr 0.01 --num-iterations 10000
Test a trained model
python main.py --load --name model1 --dataset mnist
VHDL
HDL code generation example
python hdl/vhdl/convert2vhdl.py --model model1
LLNN Testbench
We offer a testbench in VHDL code to test a trained MNIST network and additional utility functions to convert the MNIST dataset into binary inputs for hardware validation in simulation.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llnn-0.1.4.tar.gz.
File metadata
- Download URL: llnn-0.1.4.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0027a1688065b1d27b35aa3c0fa32895ba1e6f9874bfa3f3a30fdfa0dd544a4
|
|
| MD5 |
d0bd96c3ce05a6e4399818790498d9a9
|
|
| BLAKE2b-256 |
397775ae808e370df1fcb365cc8ca030c8e3728cffa631b5a7468351d6c19657
|
Provenance
The following attestation bundles were made for llnn-0.1.4.tar.gz:
Publisher:
publish.yml on capo-urjc/llnn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llnn-0.1.4.tar.gz -
Subject digest:
d0027a1688065b1d27b35aa3c0fa32895ba1e6f9874bfa3f3a30fdfa0dd544a4 - Sigstore transparency entry: 1255801012
- Sigstore integration time:
-
Permalink:
capo-urjc/llnn@53cc530c84f47913378664e1c8fe79e36b8bc19a -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/capo-urjc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@53cc530c84f47913378664e1c8fe79e36b8bc19a -
Trigger Event:
release
-
Statement type:
File details
Details for the file llnn-0.1.4-py3-none-any.whl.
File metadata
- Download URL: llnn-0.1.4-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1474a906703ce064208710a744bf117162d67f88445b9010d12c98cb4ed2ed9
|
|
| MD5 |
5200d77720588092689502528908da68
|
|
| BLAKE2b-256 |
9f5a9fdfb32b18e21bee84e00b93dd26364aef7a90bc736501d8a7971833f60d
|
Provenance
The following attestation bundles were made for llnn-0.1.4-py3-none-any.whl:
Publisher:
publish.yml on capo-urjc/llnn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llnn-0.1.4-py3-none-any.whl -
Subject digest:
f1474a906703ce064208710a744bf117162d67f88445b9010d12c98cb4ed2ed9 - Sigstore transparency entry: 1255801142
- Sigstore integration time:
-
Permalink:
capo-urjc/llnn@53cc530c84f47913378664e1c8fe79e36b8bc19a -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/capo-urjc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@53cc530c84f47913378664e1c8fe79e36b8bc19a -
Trigger Event:
release
-
Statement type: