tensorflow - LSTM 层输出大小与 KERAS 中的隐藏状态大小
问题描述
我无法理解 LSTM 的概念并在 Keras 上使用它。在考虑 LSTM 层时,输出大小和隐藏状态大小应该有两个值。
1. hidden state size : how many features are passed across the time steps of a samples when training the model
2. output size : how many outputs should be returned by particular LSTM layer
但在 keras.layers.LSTM 中,只有一个参数,用于控制层的输出大小。
问题:
Therefore how hidden state size of the LSTM layer can be changed?
如果我被误解,更正非常感谢。
解决方案
您对 LSTM 中隐藏单元和输出单元的差异感到困惑。请参阅以下链接以获得更好的清晰度:
https://jasdeep06.github.io/posts/Understanding-LSTM-in-Tensorflow-MNIST/
基本上你在 num_units 中提供的只是 LSTM 隐藏单元的大小。从这篇文章中可以很清楚地看到这一点。
推荐阅读
- sql - find views and stored procedures that reference specific field (MS SQL)
- java - 在菜单中重复 for 循环
- android - 如何检查滚动视图的可见百分比?
- android - 未调用 Android GcmListenerService onMessageReceived() 方法
- c - C逐行读取文件到动态数组失败但使用静态数组它可以工作吗?
- android - Recyclerview 不显示第一次项目
- elasticsearch - grok 解析数据的重复字段值
- java - SMBJ:如何打印特定子文件夹中的所有文件
- eclipse - 为我的 Xtext 项目执行“Eclipse 应用程序”运行配置时发出 SIGSEGV 信号
- python - 填写文本框并单击搜索按钮 - 使用 selenium 进行网络抓取