Comments (3)
Hi! Yes that would work but doing inference with matrix multiplication gives ok performance only with small trees. With deep trees it is better to use the other strategies.
from hummingbird.
Thanks for the response, I'm getting matrix dimensions errors. I loop through the state_dict
and append the weights to a list with the following structure:
I have the outcome categories under the variable name classification
, however, when I perform the following code:
input_list = np.array([1.5, 2, 3.5, 5, 4])
result = np.matmul(input_list, weights[0])
result = np.matmul(result, weights[1])
result = np.matmul(result, weights[2])
result = np.matmul(result, weights[3])
result = np.matmul(result, weights[4])
I get dimension errors for the calculations. I tried the transpose and it gets me one layer in and crashes. I also tried the following configuration:
result = np.matmul(weights[0], input_list)
result = np.matmul(result, weights[1])
result = np.matmul(result, weights[2]) # crashes here
result = np.matmul(weights[3], result)
result = np.matmul(weights[4], result)
but it crashes. What approach can I take to perform the calculations? Also, thank you for the highlight for the deep trees. Do you have any links or search terms for these higher-performance strategies so I can read them? I'm also going to try and attempt random forests afterward. Can I perform calculations on the random forests in the same way I do with the decision trees? I appreciate they are a collection of decision trees. I appreciate the time spent replying to such things, my efforts will be open-sourced to enable people to serve Forrest models without needing runtimes. It's being built in rust but will have python bindings.
from hummingbird.
Here is the paper containing experiments and a description of the other approaches for trees evaluation.
Here is the execution of the tree evaluation using matrix multiplications. You can try to replicate this.
from hummingbird.
Related Issues (20)
- Build is failing - SKL 1.3 release HOT 1
- TVM MacOS pipeline failing again HOT 1
- New LGBM Version 4.0.0 changes HOT 2
- TVM + Mac HOT 3
- XGBoost 2.0.0 breaks tests HOT 8
- Example cases for DecisionTreeClassifier HOT 2
- onnxruntime==1.16.0 release breaks tests HOT 3
- if i have saved a pytorch_based model, i want to run inference on cpu, how to change the codes? HOT 5
- Adding more ONNX data types
- ONNXMLGather breaks tests HOT 2
- Support for sklearn training HOT 1
- Github Actions changes
- SKL 1.4 release breaks build HOT 3
- coredumps on Ubuntu pipeline runs HOT 2
- Documentation deploy problem
- Need to update setup.py description
- Is "Hummingbird" trademarked? HOT 3
- [Tracking Issue] Upgrade Apache TVM to v0.16.0
- onnxruntime.capi.onnxruntime_pybind11_state.Fail ONNXRuntimeError HOT 2
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 hummingbird.