How to use model.reset_states() in Keras?

后端 未结 2 1314
感情败类
感情败类 2021-02-03 11:59

I have sequential data and I declared a LSTM model which predicts y with x in Keras. So if I call model.predict(x1) and model.predic

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-03 12:26

    reset_states clears only the hidden states of your network. It's worth to mention that depending on if the option stateful=True was set in your network - the behaviour of this function might be different. If it's not set - all states are automatically reset after every batch computations in your network (so e.g. after calling fit, predict and evaluate also). If not - you should call reset_states every time, when you want to make consecutive model calls independent.

提交回复
热议问题