两个堆叠的LSTM层之间的连接是什么? [英] What is the connections between two stacked LSTM layers?

查看:886
本文介绍了两个堆叠的LSTM层之间的连接是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题就像这样一个



谢谢!

解决方案

这不是长度4,而是4个功能。



长度在输入形状中,并且永远不会变化,当您向一个LSTM进行常规输入时所发生的情况与给定LSTM时所发生的情况之间绝对没有区别一个LSTM到另一个LSTM的输出。



您只需查看模型摘要即可查看形状并了解发生了什么。您永远不会使用LSTM更改长度。



他们根本不交流。每个尺寸都取长度尺寸,并与另一个尺寸独立地循环加工。当一个完成并输出张量时,下一个获取张量并按照相同的规则单独处理它。


The question is like this one What's the input of each LSTM layer in a stacked LSTM network?, but more into implementing details.

For simplicity how about 4 units and 2 units structures like the following

model.add(LSTM(4, input_shape=input_shape,  return_sequences=True))
model.add(LSTM(2,input_shape=input_shape))

So I know the output of LSTM_1 is 4 length but how do the next 2 units handle these 4 inputs, are they fully connected to the next layer of nodes?

I guess they are fully connected but not sure like the following figure, it was not stated in the Keras document

Thanks!

解决方案

It's not length 4, it's 4 "features".

The length is in the input shape and it never changes, there is absolutely no difference between what happens when you give a regular input to one LSTM and what happens when you give an output of an LSTM to another LSTM.

You can just look at the model's summary to see the shapes and understand what is going on. You never change the length using LSTMs.

They don't communicate at all. Each one takes the length dimension, processes it recurrently, independently from the other. When one finishes and outputs a tensor, the next one gets the tensor and process it alone following the same rules.

这篇关于两个堆叠的LSTM层之间的连接是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆