gpt4 book ai didi

machine-learning - RNN : What is the use of return_sequences in LSTM layer in Keras Framework

转载 作者:行者123 更新时间:2023-11-30 08:53:36 25 4
gpt4 key购买 nike

我在 RNN 工作。我有来自某个网​​站的以下代码行。如果您观察到第二层没有“returnSequence”参数。

我假设返回序列是强制性的,因为它应该返回序列。您能告诉我为什么没有定义吗?

第一层 LSTM:

regressor.add(LSTM(units = 30, return_sequences = True))

第二层LSTM:

regressor.add(LSTM(units = 30))

最佳答案

return_sequences参数设置为False(默认)时,网络将仅输出hn,即最后时间步。否则,网络将输出隐藏状态的完整序列,[h1, h2, ..., hn]。该层的内部方程不变。引用documentation .

关于machine-learning - RNN : What is the use of return_sequences in LSTM layer in Keras Framework,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51376770/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com