Page 1 of 1

Nonparametric machine learning model written in CF2.1 firmware.

Posted: Mon Mar 01, 2021 3:47 am
by imranmomtaz
Hello,
Is there any nonparametric machine learning model written in CF2.1 firmware? I am specifically looking for a nonparametric machine learning model for regression operation. It can be decision tree, gaussian process regression anything. Thanks a lot in advance.

Re: Nonparametric machine learning model written in CF2.1 firmware.

Posted: Mon Mar 01, 2021 1:13 pm
by whoenig
I am only aware of parametric ML models (e.g., Deep FeedForward Neural Networks: https://github.com/TaoChenOSU/quad_nn) with online inference (not learning). However, if you can find any pure C implementation of your desired nonparametric model, it should be possible to add to the firmware. Note that you are of course limited in terms of memory and computation. Ideally, your model would not require any dynamic memory allocations.

Re: Nonparametric machine learning model written in CF2.1 firmware.

Posted: Tue Mar 02, 2021 4:26 am
by imranmomtaz
Thank you for your reply. However, I am also looking for implementation in C. Is there anybody who know of any such implementation? Thanks.

On a different note, I think it possible to have a cpp file as extern which would implement a regression model. Is there any work which does this?

Re: Nonparametric machine learning model written in CF2.1 firmware.

Posted: Tue Mar 02, 2021 11:53 am
by arnaud
About the cpp, if you can generate a lib without any dependencies, you can then link it with the crazyflie without problem (you would just have to add yourlib.a to the PROJ_OBJ list in your makefile). I have already done that with Rust for example. However I have also tried to compile CPP directly in the Crazyflie (ie. compile the Crazyflie with the CPP compiler) and this did not work at all. So the solution is to compile a static lib that exposes C functions and then link it to the Crazyflie firmware.