https://www.zhihu.com/question/64470274

http://colah.github.io/posts/2015-08-Understanding-LSTMs/

https://jasdeep06.github.io/posts/Understanding-LSTM-in-Tensorflow-MNIST/

https://stackoverflow.com/questions/37901047/what-is-num-units-in-tensorflow-basiclstmcell#

http://keras-cn.readthedocs.io/en/latest/layers/recurrent_layer/

keras.layers.recurrent.LSTM(units, activation='tanh', recurrent_activation='hard_sigmoid', use_bias=True, kernel_initializer='glorot_uniform', recurrent_initializer='orthogonal', bias_initializer='zeros', unit_forget_bias=True, kernel_regularizer=None, recurrent_regularizer=None, bias_regularizer=None, activity_regularizer=None, kernel_constraint=None, recurrent_constraint=None, bias_constraint=None, dropout=0.0, recurrent_dropout=0.0)

model = Sequential()

model.add(LSTM(32, return_sequences=True, stateful=True,batch_input_shape=(batch_size, timesteps, data_dim)))
model.add(LSTM(32, return_sequences=True, stateful=True))
model.add(LSTM(32, stateful=True))
model.add(Dense(num_classes, activation='softmax'))

类似上述代码中,加重黑色数字的含义。

下图是加了peephole的lstm,用来示例,lstm则需要去掉Ct-1和Ct项。可以看到LSTM里面有几个参数矩阵,Wf、Wi、Wo都是参数矩阵。我的理解,上面的数字32就是这个参数矩阵的组数。比如初始一组参数矩阵,Wf、Wi、Wo,计算一个lstm值,然后再给一组参数矩阵Wf1、Wi1、Wo1,可以再算一个lstm值,共32组。参考的博客里第一个也是类似的解释。

最新文章

  1. uploadify批量上传
  2. Linux 常用操作命令
  3. zookeeper选举原理
  4. 分布式消息队列 Kafka
  5. ASP.NET DAY1
  6. (Java和C++)二进制date数据写进android保存为yuv格式
  7. Git 放弃修改
  8. 检查c# 内存泄漏
  9. POJ 2965 The Pilots Brothers' refrigerator 暴力 难度:1
  10. 优麒麟(UbuntuKylin)不是国产Linux操作系统
  11. 关联规则算法Apriori的学习与实现
  12. 使用Gradle编译release apk报错:Please correct the above warnings first
  13. Ecstore1.2启用mongodb添加索引
  14. 直接执行SQL语句的快捷键是什么啊?嘎嘎
  15. 主成分分析 SPSS、python实例分析
  16. CSS和DIV
  17. 『Python × C++』函数传参机制学习以及对比
  18. 【奇技淫巧】绕过waf写文件
  19. Java如何格式化24小时格式的时间?
  20. [leetcode]543. Diameter of Binary Tree二叉树直径

热门文章

  1. dbgrideh添加列、多表头及属性
  2. elasticsearch 出现“java.lang.OutOfMemoryError: Java heap space”
  3. 不看好运维竖井产品模式,优云打造融合化运维PaaS平台
  4. HBase系列文章(转)
  5. redis分布式锁(转)
  6. kmeans笔记
  7. 转: js实现全角半角检测的方法
  8. 王者荣耀里拿个王者有啥了不起,有胆就来挑战一下ApsaraCache源码
  9. Tomcat7目录结构详解
  10. Java-idea-常用插件-lombok