TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Transform ML models into native code with zero dependencies

184 点作者 ghosthamlet大约 6 年前

11 条评论

jononor大约 6 年前
Other similar projects:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;nok&#x2F;sklearn-porter" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;nok&#x2F;sklearn-porter</a> Supports many scikit-learn models to Java&#x2F;C&#x2F;JavaScript&#x2F;Go&#x2F;Ruby, at least since 2016.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;konstantint&#x2F;SKompiler" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;konstantint&#x2F;SKompiler</a> transpiles to Excel&#x2F;SQL<p><a href="https:&#x2F;&#x2F;github.com&#x2F;jonnor&#x2F;emlearn" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jonnor&#x2F;emlearn</a> To C only, focus on microcontrollers&#x2F;embedded devices. Includes feature extraction tools also. Disclaimer: I wrote it.
评论 #19308229 未加载
sanjoy_das大约 6 年前
Similar: tfcompile AOT compiles TensorFlow models into native code using XLA (<a href="https:&#x2F;&#x2F;www.tensorflow.org&#x2F;xla&#x2F;tfcompile" rel="nofollow">https:&#x2F;&#x2F;www.tensorflow.org&#x2F;xla&#x2F;tfcompile</a>).
isolli大约 6 年前
Does anyone know of a similar idea for neural networks? As far as I can tell, you need the entire framework (which requires a heavy, 1.5 GB docker image) to apply a trained model, even though in theory you only need matrix multiplication and a few activation functions.<p>Related: <a href="https:&#x2F;&#x2F;onnx.ai&#x2F;" rel="nofollow">https:&#x2F;&#x2F;onnx.ai&#x2F;</a>
评论 #19309985 未加载
评论 #19309407 未加载
评论 #19310770 未加载
评论 #19309808 未加载
wodenokoto大约 6 年前
There are similar libraries for converting ML models into SQL queries.<p>However, the important part of most models is not the `estimator.fit(X, y)` line, but all the things that are done to X before fitting or estimating.
评论 #19310880 未加载
cognaitiv大约 6 年前
You might consider supporting sklearn.preprocessing objects as well to replicate any transformations applied to training data.
s0ck_r4w大约 6 年前
Hey folks! One of the authors here. Somehow this post went under our radar. Thank you all for your comments and feedback! We&#x27;re super excited about the amount of attention that this project has gotten. This motivates us to work even harder and to deliver even more cool stuff. Go and JS support are definitely on our agenda. Shouldn&#x27;t be too hard to add since we first transform models into AST and only then interpret AST into a specific language. I might be wrong but this is a very crucial detail that distinguishes m2cgen from similar projects like sklearn-porter. As a result models are completely decoupled from languages and can be worked on independently. Once you implement a particular model, all languages get its support automatically. And vice versa. Plus we support XGBoost and LightGBM :) SVM support is something we&#x27;ll be focusing on from the modeling side of things. Any contributions are much appreciated!
wespiser_2018大约 6 年前
One big improvement for this project would be to somehow break out the model weights into an additional dependency, or file, to allow for very large models and separation between &quot;code&quot; and &quot;data. Overall, pretty good, the alternative approach is either using the underlying C++ lib, or just doing some matrix math!
评论 #19313932 未加载
nerfhammer大约 6 年前
Now do it for tensorflow. Let&#x27;s say I want to generate AI faces on a small ARM processor.
评论 #19310561 未加载
rajangdavis大约 6 年前
This is pretty cool idea! Would there be any possibility of trying to convert a model to javascript&#x2F;node?<p>Haven&#x27;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.
评论 #19309618 未加载
tixocloud大约 6 年前
Thanks for sharing. This is quite interesting as we’ve been mulling over library support for our platform.
mahomedalid大约 6 年前
What are the advantages?
评论 #19308388 未加载