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

How to Quantize input and output? #2

Open
JochiSt opened this issue Feb 28, 2025 · 1 comment
Open

How to Quantize input and output? #2

JochiSt opened this issue Feb 28, 2025 · 1 comment

Comments

@JochiSt
Copy link

JochiSt commented Feb 28, 2025

In my application, I've a datastream, which has a defined bitformat. This should input the neural network and the output of the neural network should also have a defined bitwidth to be able to enter the next stage (which also already exists).

What I got so far is, that I'm able to fix the input bitsize by using a signature layer, but I've no clue, how to fix the output's bitwidth. I'm wondering, whether I've overseen this part in the documentation.

@calad0i
Copy link
Owner

calad0i commented Mar 2, 2025

Sorry for the late reply. GitHub signed me out for some reason...

Fixing the output size of the datastream can only be partially done for the fractional part by setting the weight to be none-trainable, as the integer part will still be adaptive during training.

While I would not expect this to be a significant issue during training, some manual efforts will be required to fix the output size of the output pipe (e.g., overriding result_t in the converted hls4ml model.)

In the next release of this library, finer control would be possible, including fixing the quantizer sizes.

p.s.,

result_t naming maybe changed in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants