mpatacchiola / dissecting-reinforcement-learning

Python code, PDFs and resources for the series of posts on Reinforcement Learning which I published on my personal blog
https://mpatacchiola.github.io/blog/
MIT License
609 stars 175 forks source link

Alternative to Numpy #1

Closed abencomo closed 7 years ago

abencomo commented 7 years ago

I would like to try your code on the pyboard and the OpenMV boards. Unfortunately, Numpy is huge so it cannot be installed on a microcontroller. Will it be possible to using list, a bytearray, or an array.array; to implement the functions you are using from numpy?

mpatacchiola commented 7 years ago

Hi abencomo

Yes sure, you can easily replace Numpy. In the code I provided I used Numpy only for element-wise matrix addiction and matrix-scalar multiplication. If you create your own function for these two operation you are done. I used matrices but you can use lists instead. However you should be careful because some algorithm are computationally expensive. The limited hardware of a microcontroller could take hours to converge to stable solutions. What I suggest you is to find an optimal policy running the script on a workstation and then load the policy in you microcontroller.