Giter Site home page Giter Site logo

RF results about conifer HOT 2 OPEN

thesps avatar thesps commented on August 16, 2024
RF results

from conifer.

Comments (2)

kdruart29 avatar kdruart29 commented on August 16, 2024 1

Hi!

Actually the conversion is doing great, the trees are correctly saved in the parameters.h file. The issue is with how RF and BDT are implemented in Sklearn
In Sklearn, BDT are converted into subtrees for each class in each estimator wheras RF use a single tree, so the BDT_rolled.cpp can't do the other classes because it expects subtrees for each class. I solved this by modifying the way the value field is converted, adapted the BDT header and cpp file to accept the multiclass RF. Issue is it's not compatible with BDT now, just RF for my case. I plan on commiting my code when fully compatible.

The accelerator workflow is surprisingly easy and it works very well. The only difficulty was to find a compatible image of pynq for my zcu102.

from conifer.

thesps avatar thesps commented on August 16, 2024

Hi, thanks for reaching out.

I think there are a few things going on, but it seems to me that the Random Forest conversion is not working correctly, at least for multi-class problems. I tried working with the same wine dataset and see similar nonsense results to yours, and I can see 'missing' trees in the converted model firmware under firmware/parameters.h (missing tree indices). For a binary classification example the results looked more compatible between sklearn and the conifer HLS.

One effect that is smaller, but would eventually need to be taken into account for this dataset is the data types. The defaults probably don't work well for the features in this case. In general this is dataset dependent, but for the wine example a better configuration might be:

# Create a conifer config
cfg = conifer.backends.xilinxhls.auto_config(granularity='full')
cfg['InputPrecision'] = 'ap_fixed<18,16>'
cfg['ThresholdPrecision'] = 'ap_fixed<18,16>'
cfg['ScorePrecision'] = 'ap_fixed<18,8,AP_RND_CONV,AP_SAT>'

Besides your issue, it seems that you used the accelerator support and ran on a device. Since this is a quite new feature I'm also looking for feedback on that part of the workflow. Was it easy enough to make the bitfile and run it on the board?

from conifer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.