代码之家  ›  专栏  ›  技术社区  ›  Tulsi

Keras中LSTM中的多层隐藏层

  •  1
  • Tulsi  · 技术社区  · 8 年前
    x = Input(shape=(timesteps, input_dim,))
    
    # LSTM encoding
    h = LSTM(2048)(x)
    

    这是我从网上下载的文件中的几行代码。我想 h

    1 回复  |  直到 8 年前
        1
  •  3
  •   parsethis    8 年前

    g )! 但是,既然我们正在传递给另一个 LSTM 层,我们必须添加 return_sequences

    x = Input(shape=(timesteps, input_dim,))
    
    # LSTM encoding
    h = LSTM(2048, return_sequences=true)(x)
    g = LSTM(10)(h)