I'm trying to run an RNN trained in Keras in an application that run's in real-time. The "time" in the recurrent network (it's an LSTM) here are actual moments in time when data is received.
I want to get the output of the RNN in an online fashion. For non-recurrent models, I just shaped my input into the shape inputDatum=1,input_shape
and run Model.predict
on it. I'm not sure this is the intended method of using forward pass in Keras for the application, but it worked for me.
But for recurrent modules, Model.predict
expects as input the whole input, including temporal dimension. So it does not work...
Is there a way to do this in Keras or do I need to go down to Tensorflow and implement the operation there?