RNN on microcontroller based systems I'm currently developing a RNN with Python and Keras/TensorFlow for time series prediction. My final objective is to port the (trained) RNN to an embedded system, which should collect the input time series from sensors and run them through the RNN and output a time series (prediction) in real time, or at least in approximately real time. 
So, my questions are: (1) is it possible to port a trained RNN (Python based Keras/TensorFlow model) into an embedded system? And (2) if so, which embedded platforms would you recommend to perform such a task? 
If you could share references which relate to the questions, it would also help me a lot.
Thank you.  
Obs.: the RNN is composed of 5 layers with 32, 16, 8, 4 and 2 LSTM units each. The inputs of the network are 2 time series, with sizes ranging from 10000 to 200000 samples; in the PC I handle them using Python generators, training and running the network with batches of 128 samples. 
I think that reducing the size of the network would not cause to many issues (regarding the precision of the output series).
 A: This would be my approach to it:
First, estimate the memory needed for the LSTM: How can calculate number of weights in LSTM
I get that calculation to be 8552 params for all your layers. Now consider that each parameter will need to be stored as a floating point value. If we assume 32-bit resolution of these parameters is ok, you will need 4 bytes per parameter, so your lower memory bound will be:
lstm_parameter_memory_size = parameters * 4 
lstm_parameter_memory_size = 34208 bytes
Of course you will need more memory than this, but this is (for the LSTM) the dominating factor. The exact timing response will require quite the analysis, so I suggest to use a tool to check Keras/TensorFlow execution or make a rough estimate on the number of instructions per LSTM unit.
A more pragmatic and less theoretical approach:
Buy something like an ESP-32, implement the LSTM in C and just try it. It is a powerful and inexpensive device: https://en.wikipedia.org/wiki/ESP32. This approach allows you to scale your hardware solution down or up also, since most platforms will run your C code with smaller adjustments.
A: Empirical results often indicate (e.g. [1]) that simpler gated RNN's (e.g. MGU or GRU) perform comparably to LSTM, and since in microcontroller application memory consumption is important, I would suggest to work with simpler gated RNN models instead of LSTM. [2] is my old implementation of GRU for microcontrollers (e.g. teensy 3.6). 
[1] https://arxiv.org/pdf/1412.3555v1.pdf 
[2] https://github.com/povidanius/gru_neurocontroller
A: Just to extend the possibilities stated by the accepted answer
1) Yes, it is possible to port RNNs to microcontrollers. An example of a library for doing so is CMSIS-NN. They even have a GRU example and more detailed procedures in its web page, such as how to convert a network.
Another possibility is TFMicro, but be aware that currently you will, I could assure, problems quantizing RNNs. However, if you do not quantize it, there shouldn't be any problem.
2) Depending on the easiness that you need I would choose one or another platform. For example, if you want an easy path you can choose a platform supported by TFLite for Microcontrollers. If you want to work on quantization patterns and so, I would, as stated by @Nenovrak, compute the model requirements in terms of size but also in terms of RAM, and then I would choose an appropriate microcontroller with an ARM CPU, juswt to use CMSIS on it.
A: In addition to the tools mentioned by @BCjuan, there is also.
https://github.com/majianjia/nnom
a platform independent inference engine for neural networks. It takes a Keras model as input.
X-CUBE-AI from ST Microelectronics. It is however proprietary and only supports their devices.
A: Haven't tried but would seem the CMSIS examples have been ported to ESP32
https://github.com/UT2UH/ML-KWS-for-ESP32
Forked from ARM's Keyword spotting for Microcontrollers using frankie "whyengineer" fork of ARM's CMSIS for ESP32
This repository consists of the tensorflow models and training scripts used in the paper: Hello Edge: Keyword spotting on Microcontrollers. The scripts are adapted from Tensorflow examples and some are repeated here for the sake of making these scripts self-contained.
