【问题标题】:LSTM Autoencoder for sequence data用于序列数据的 LSTM 自动编码器
【发布时间】:2020-07-03 16:24:53
【问题描述】:

我对 LSTM 领域完全陌生。是否有任何提示可以优化我的自动编码器以重建 len = 300 序列的任务

瓶颈层应该有 10-15 个神经元

model = Sequential()
model.add(LSTM(128, activation='relu', input_shape=(timesteps,1), return_sequences=True))
model.add(LSTM(64, activation='relu', return_sequences=False))
model.add(RepeatVector(timesteps))
model.add(LSTM(64, activation='relu', return_sequences=True))
model.add(LSTM(128, activation='relu', return_sequences=True))
model.add(TimeDistributed(Dense(1)))
model.compile(optimizer='adam', loss='mae')

代码复制自:https://towardsdatascience.com/step-by-step-understanding-lstm-autoencoder-layers-ffab055b6352

目前结果只是一个 nan 的序列:[nan, nan, nan ... nan, nan]

序列类似于下图:

【问题讨论】:

    标签: python keras lstm


    【解决方案1】:

    我相信您在这里使用的激活函数,即“relu”可能会扼杀渐变。尝试使用适合您数据的其他激活函数,例如“tanh”。

    【讨论】:

      猜你喜欢
      • 2018-10-01
      • 2018-03-11
      • 2018-07-16
      • 2019-12-26
      • 2017-11-22
      • 2019-04-29
      • 1970-01-01
      • 1970-01-01
      • 2022-08-14
      相关资源
      最近更新 更多