将scikit-learn ML模型转换为微控制器的C语言 [英] Converting scikit-learn ML Models into C language for Microcontrollers
问题描述
我正在使用 scikit-learn 软件包评估各种ML模型.我正在验证 Logistic回归,SVM和随机森林分类器,该功能可在sci-kit学习中使用.第一步,我正在使用Python进行这些工作.
I am evaluating various ML models using scikit-learn package. I am validating Logistic Regression, SVM and Random Forest Classifier which is avaialble on sci-kit learn. In the first step, I am working on these using Python.
我想将这些分类器算法和训练有素的ML模型部署到微控制器中.我需要将 scikit-learn 中的 ML 算法从 Python 转换为 C 或 C++,然后将代码写入我的 MCU.
I would like to deploy these classifier algorithms and the trained ML model into a microcontroller. I would need to convert my ML algorithm in scikit-learn from Python to C or C++ and then flash the code into my MCU.
我查看了Internet,找不到任何用C/C ++语言编写的scikit-learn软件包的库.
I looked over the internet and I could not find any librabries of scikit-learn packages written in C/C++ language.
如果无法直接通过scikit-learn进行迁移,是否有任何用C语言编写的ML分类器库(逻辑回归,SVM,随机森林分类器)?
If it is not directly possible to migrate with scikit-learn, are there any ML Classifier libraries (Logistic Regression, SVM, Random Forest Classifier) written in C language?
推荐答案
您正在寻找的是边缘ML解决方案.我不知道有什么方法可以直接在微控制器上间接部署这是用于微控制器的Tensorflow Lite .其他选项包括Microsoft的嵌入式学习库或 scikit-learn
模型,但是
What you're looking for is an edge ML solution. I'm not aware of any way to directly on indirectly deploy a This sklearn-porter project might be just what you're looking for. There's also plenty of other interesting work going on. One thing you definitely should have a look at is Tensorflow Lite for Microcontrollers. Other options include Microsoft's Embedded Learning Library or Edge ML Library.scikit-learn
model on a microcontroller, but
对于ARM设备,您还应该查看 CMSIS-NN库,甚至更具体地讲到 X-CUBE-AI扩展打包(如果您使用的是stm32设备).
For ARM devices you should also look into CMSIS-NN library and even more specifically into X-CUBE-AI extension pack if you're using an stm32 device.
这篇关于将scikit-learn ML模型转换为微控制器的C语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!