machine-learning - 如何重置 Keras 中的状态变量?

标签 machine-learning theano keras recurrent-neural-network

我正在构建一个 RNN (LSTM/GRU),并且我有可变长度的时间序列。每个时间序列完成后如何重置状态变量?我想在 Keras 中执行此操作,但如果我必须在 Theano(我的后端)中构建 RNN,那也很好。

最佳答案

它不在 Keras 的文档中,但循环层有一个 .reset_state() 函数。您可以在 github 上找到它,您可以重置一层或整个模型的状态。

关于machine-learning - 如何重置 Keras 中的状态变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38958288/

相关文章:

python - Tensorflow 摘要指标未初始化(与 Tensorboard 一起使用)

machine-learning - PySpark ML : Get KMeans cluster statistics

machine-learning - word2vec中单词的向量代表什么?

numpy - theano dot产品是如何播出的

python - Keras 中的 "metrics"是什么?

python - 100万个对象的层次聚类

python - 在 GPU (windows) 上运行 Theano 的命令

python - 使用 python pydot 时出错

Tensorflow:设置 XLA_GPU_JIT 设备编号 0 时 XLA 服务不支持设备 CUDA:0

python - 突然的 Tensorflow/Keras Google Colab 依赖问题 `AttributeError: module ' tensorflow._api.v1.compat.v 2' has no attribute ' __internal_ _'`