简体   繁体   English

LSTM 输入和 Keras 中的 output 维度

[英]LSTM input and output dimensions in Keras

I am confused about LSTM input/output dimensions, specifically in keras library.我对 LSTM 输入/输出维度感到困惑,特别是在 keras 库中。 How do keras return 2D output while its input is 3D? keras 如何在其输入为 3D 时返回 2D output? I know it can return 3D output using “return_sequence = Trure,” but if return_sequence = False, how can it deal with 3D and produces 2D output?我知道它可以使用“return_sequence = True”返回 3D output,但如果 return_sequence = False,它如何处理 3D 并生成二维 output? For example, if input data of shape (32, 16, 20), 32 batch size, 16 timestep, 20 features, and output of shape (32, 100), 32 batch size, 100 hidden states;例如,如果输入数据的形状为 (32, 16, 20),批大小为 32,时间步长为 16,特征为 20,而形状为 (32, 100),批大小为 32,隐藏状态为 output 的输入数据; how keras processes input of 3d and returns output 2d. keras 如何处理 3d 的输入并返回 output 2d。 Additionally, how can concatenate input and hidden state if they don't have the exact dimensions?此外,如果输入和隐藏的 state 没有确切的尺寸,如何连接它们?

I found the answer to my question in the link below: https://mmuratarat.github.io/2019-01-19/dimensions-of-lstm it's very helpful!我在下面的链接中找到了问题的答案: https://mmuratarat.github.io/2019-01-19/dimensions-of-lstm这非常有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM