GithubHelp home page GithubHelp logo

Comments (3)

interesaaat avatar interesaaat commented on June 11, 2024

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.

maxwellflitton avatar maxwellflitton commented on June 11, 2024

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:

Screenshot 2023-09-19 at 10 02 44

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.

interesaaat avatar interesaaat commented on June 11, 2024

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)

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.