Live data from Hacker News

Transform ML models into native code with zero dependencies

github.com

1–10 of 27 posts

Re: Transform ML models into native code with zero dependencies

#2
This is pretty cool idea! Would there be any possibility of trying to convert a model to javascript/node?

Haven't looked through the source but it looks like the generated code is a essentially the weights from a trained model transformed into a function for the target language.

Re: Transform ML models into native code with zero dependencies

#3
Other similar projects:

https://github.com/nok/sklearn-porter Supports many scikit-learn models to Java/C/JavaScript/Go/Ruby, at least since 2016.

https://github.com/konstantint/SKompiler transpiles to Excel/SQL

https://github.com/jonnor/emlearn To C only, focus on microcontrollers/embedded devices. Includes feature extraction tools also. Disclaimer: I wrote it.

Re: Transform ML models into native code with zero dependencies

#4
post #3

Other similar projects: https://github.com/nok/sklearn-porter Supports many scikit-learn models to Java/C/JavaScript/Go/Ruby, at least since 2016. https://github.com/konstantint/SKompiler transpiles to Excel/SQL https://github.com/jonnor/emlearn To C only, focus on microcontrollers/embedded devices. Includes feature extraction tools also. Disclaimer: I wrote it.

Thanks for sharing this! Looking at sklearn-porter now, hope I can contribute to the either the Ruby, Golang, or PHP library.

Re: Transform ML models into native code with zero dependencies

#7
post #6

What are the advantages?

Trained ML models that run as native code with zero dependencies.

Heck, you could even put it into a lambda function on a lambda service and deploy in like 5 min! That is a lot of value.

Re: Transform ML models into native code with zero dependencies

#9
post #6

What are the advantages?

Trained ML models that run as native code with zero dependencies.

Note though that e.g. liblinear models are trivial to load and apply yourself - most classifiers just compute the matrix-vector product between the weight matrix and an instance vector and take the class with the highest activation. That route has the benefit that you do not hardcode a model, but can easily load new models.

Not to criticize this project. This looks nice and has many useful applications.

Post reply on HN