转自https://blog.csdn.net/shunaoxi2313/article/details/99843368,写的很清楚很棒的一篇博客,在图里对应一下,方便回忆。
- 参数
– input_size
– hidden_size
– num_layers
– bias
– batch_first
– dropout
– bidirectional - 输入
– input (seq_len, batch, input_size)
– h_0 (num_layers * num_directions, batch, hidden_size)
– c_0 (num_layers * num_directions, batch, hidden_size) - 输出
– output (seq_len, batch, num_directions * hidden_size)
– h_n (num_layers * num_directions, batch, hidden_size)
– c_n (num_layers * num_directions, batch, hidden_size)
对以上参数的解释看详见这张图:batch_size都被忽略不管了。bidirectional就是让每个cell有两端的输入,也先不管了。