Porting Libraries important for Machine Learning to Micropython

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
Mr. Panda
Posts: 2
Joined: Tue Mar 30, 2021 11:49 am

Porting Libraries important for Machine Learning to Micropython

Post by Mr. Panda » Tue Mar 30, 2021 12:11 pm

Hi,

Is there any work in progress about migrating ML-related libraries like Pandas and Numpy to Micropython.

I am trying to implement an Isolation Forest https://scikit-learn.org/stable/modules ... orest.html on Pycom LoPy board but could not succeed due to lack of those libraries. I have tried to convert by myself but I guess it is something that I am capable to do it alone.

So, I am just curious if there is any work is being done regarding porting such a libraries? I could not find any on GitHub.

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

Re: Porting Libraries important for Machine Learning to Micropython

Post by stijn » Tue Mar 30, 2021 1:09 pm

There's https://micropython-ulab.readthedocs.io/en/latest which implements core numpy functionality, but it's not really a port (depending on your definition of that): it's implemented from scratch, because numpy etc use the CPython object model which is very different from the MicroPython one. I don't know of any scikit/pandas/... implementations. It would be a huge amount of work to implement all of that. The usual workaround would be sending your data from MicroPython to a remote CPython process and doing calculations there, then sending results back. Could use mqtt for coomunication for instance.

Mr. Panda
Posts: 2
Joined: Tue Mar 30, 2021 11:49 am

Re: Porting Libraries important for Machine Learning to Micropython

Post by Mr. Panda » Thu Apr 01, 2021 12:11 pm

Hi stijn,

Thanks, I will check that module. Currently I can apply Isolation Forest in the fog (Raspberry Pi in my case) and also in the cloud while using edge devices (pycom boards, arduinos) just to collect and forward a data. So, only applying that anomaly detection method at the edge is missing.

tecdroid
Posts: 27
Joined: Thu Apr 08, 2021 6:22 am

Re: Porting Libraries important for Machine Learning to Micropython

Post by tecdroid » Tue Apr 13, 2021 8:26 am

Hi,

is it possible to compile this into a mpy module? I don't want to re-compile and re-flash my board permanently..

User avatar
OlivierLenoir
Posts: 126
Joined: Fri Dec 13, 2019 7:10 pm
Location: Picardie, FR

Re: Porting Libraries important for Machine Learning to Micropython

Post by OlivierLenoir » Tue Apr 13, 2021 10:27 am

You can look here, it's a project about Neural Network for MicroPython.

Post Reply