thesps / conifer

Fast inference of Boosted Decision Trees in FPGAs
Apache License 2.0
48 stars 27 forks source link

Add support for Yggdrasil Decision Forests models #65

Closed achoum closed 9 months ago

achoum commented 11 months ago
thesps commented 9 months ago

Thanks a lot for this contribution, and sorry for the delay in reviewing it. To me the code is fine as is, I don't propose any changes. I've checked the tests and examples and I think all is looking good. Thanks also for the general improvements, I appreciate it.

Merging!

One query I have, that we can come back to later, is: how difficult would it be to extend support to other tasks? (if model.task() != ydf.Task.CLASSIFICATION here)

achoum commented 9 months ago

Thanks for the merge :).

how difficult would it be to extend support to other tasks?

It would be trivial. This current code would likely immediately work for regression and ranking (to be tested).

Background

In the case of GBDT, trees have the same structure for all the tasks. What changes is how the sum of the tree predictions is used (i.e., the link-function, a.k.a. activation function). Since conifer does not apply a link function, this code is more-or-less task independent.