thesps / conifer

Fast inference of Boosted Decision Trees in FPGAs
Apache License 2.0
41 stars 22 forks source link

Support different types #21

Closed thesps closed 2 years ago

thesps commented 2 years ago

Previously the HLS backend had the configurable parameter Precision to set the ap_... data type used in the HLS. Now the InputPrecision, ThresholdPrecision, and ScorePrecision can be set independently. There can be cases where the scores and thresholds/inputs have very different ranges, so this update should help in those cases. I expect setting ThresholdPrecision to the same as InputPrecision is often the best choice (since the thresholds are cuts on the inputs), so if ThresholdPrecision is unspecified it will fall back to InputPrecision (with a warning). If InputPrecision or ScorePrecision are unspecified, they will fall back to Precision.