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. Related: https://onnx.ai/
Transform ML models into native code with zero dependencies
21–27 of 27 posts
Re: Transform ML models into native code with zero dependencies
#22There are similar libraries for converting ML models into SQL queries. 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.
Re: Transform ML models into native code with zero dependencies
#23Re: Transform ML models into native code with zero dependencies
#24Re: Transform ML models into native code with zero dependencies
#25One 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 "code" and "data. Overall, pretty good, the alternative approach is either using the underlying C++ lib, or just doing some matrix math!
Re: Transform ML models into native code with zero dependencies
#26One 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 "code" and "data. Overall, pretty good, the alternative approach is either using the underlying C++ lib, or just doing some matrix math!
The package sklearn-porter supports the separation between inference (code) and model data (parameters) by passing `export_data=True` while transpiling the trained estimator.