Keras中使用LSTM层时设置的units参数是什么
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组。参考的博客里第一个也是类似的解释。
相关文章
- trunk口设置vlan_wan口配置什么意思
- 三种方法告诉你项目超过255个摄像机怎么设置IP?什么是公网ip?什么又是内网ip?为什么ip地址通常以192.168开头?
- GXU 与CompactLogix 1769-L32E DF1 通讯设置说明
- 光猫和调制解调器-光猫是什么_电信光猫怎么设置?
- JS如何为表单聚焦控件设置醒目的样式
- 安卓APP证书高级设置中,这些分别代表什么,从哪里可以获取到呢?
- 部署Linux服务器,完善网络设置(linux服务器网络设置)
- Linux 目录权限设置指南(linux目录赋予权限)
- MySQL设置字段唯一:一招制胜(mysql设置字段唯一)
- MySQL中关于别名配置的技巧(mysql设置别名)
- MySQL:定制用户权限以保障安全(mysql设置用户权限)
- Linux下配置JDK环境变量的步骤(linux设置jdk环境变量)
- Linux 文件夹所有者的设置方法(linux文件夹所有者)
- 设置Linux系统挂载参数设置完全指南(linux挂载参数)
- MySQL的三权分立设置是什么,如何实现(mysql三权分立设置)
- 重新设置Redis登录密码,安全保障更高(修改redis的登录密码)
- Redis中设置自动过期触发器(redis 过期 触发器)