【发布时间】:2019-12-10 13:54:17
【问题描述】:
如何使用 Tensorflow 在标准 LSTM 网络之前添加额外的前馈层?
【问题讨论】:
标签: tensorflow lstm feed-forward
如何使用 Tensorflow 在标准 LSTM 网络之前添加额外的前馈层?
【问题讨论】:
标签: tensorflow lstm feed-forward
n_timesteps = 15
n_dim = 5
model = models.Sequential()
model.add(layers.TimeDistributed(layers.Dense(10, activation='relu'), input_shape=(n_timesteps, n_dim)))
model.add(layers.LSTM(25))
model.add(layers.Dense(2, activation='softmax'))
model.compile(loss='categorical_crossentropy', optimizer='adam')
【讨论】: