Comments (2)
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.
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)
- xgboost precision HOT 2
- xgboost example VivadoHLS segfault HOT 5
- Long synthesis time on Vitis HOT 2
- sklearn_to_hls.py example issues HOT 3
- ONNX Conversion Fails with ONNX model produced from xgboost
- XGBoost feature error HOT 4
- Random Forest
- `ImportError: cannot import name 'backends'` when importing conifer HOT 2
- 'XGBClassifer' object has no attribute 'save config' HOT 5
- Bitstream generation feature HOT 3
- Type error 'module' object is not callable HOT 2
- Not working on Windows ? HOT 2
- VHDL Backend : Missing assignement in AddReduce.vhd ? HOT 7
- Exception: Couldn't find Xilinx ap_ headers HOT 7
- XGBoost 2.0.0 HOT 2
- README links broken HOT 1
- Expression balancing HOT 6
- Vivado simulation for VHDL backend
- scikit-learn AdaBoostClassifier
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from conifer.