I have defined a stateful LSTM RNN, and I want to reset the state of the RNN after each epoch. I have found that one way to do this would be:
n_epochs = 50
for i in range(n_epochs):
lstm.fit(X, y, epochs = 1, batch_size = 64)
lstm.reset_states()
Is there any other more elegant way to implement this in the model specification or when training that is supported by Keras?