pytorch之torch.nn.lstm

2019-03-28  本文已影响0人  很菜_嗯

https://morvanzhou.github.io/tutorials/machine-learning/torch/3-05-train-on-batch/

DataLoader 以及BATCH_SIZE问题

torch.nn.LSTM()输入API.

重要参数:

input_size:每个时步(time-step)输入到lstm单元的维度。(实际输入的数据size为[batch_size, input_size])

hidden_size: 确定了隐含状态hidden_state的维度.

num_layers: 叠加的层数。

示例代码:

使用单向LSTM进行MNIST分类

上一篇 下一篇

猜你喜欢

热点阅读