Skip to content

Add quantized sigmoid, fix quantized tanh for QKeras

Javier Duarte requested to merge github/fork/jmitrevs/add_quantized_sigmoid into main

Created by: jmitrevs

This is an attempt to fix quantized tanh and add quantized sigmoid activation support for QKeras ingestion. In Quartus the tanh handling probably needs an optimizer to rename it to dense_tanh (and that is why the tests fail--the hacky fix in the writer doesn't work), but for Vivado I think this generally works. Overall, though, I think this fix is only temporary. The method breaks if granularity='name' is not used in hls4ml.utils.config_from_keras_model, though this feature is not just for these quantizers.

Any suggestions?

Merge request reports

Loading