【发布时间】:2020-03-04 00:49:01
【问题描述】:
假设我们有一个用于时间序列预测的 LSTM 模型。此外,这是一个多变量案例,因此我们使用多个特征来训练模型。
ipt = Input(shape = (shape[0], shape[1])
x = Dropout(0.3)(ipt) ## Dropout before LSTM.
x = CuDNNLSTM(10, return_sequences = False)(x)
out = Dense(1, activation='relu')(x)
我们可以在 LSTM 之前(如上面的代码)或 LSTM 之后添加Dropout 层。
如果我们在 LSTM 之前添加它,它是在时间步长(时间序列的不同滞后)或不同的输入特征上应用 dropout,还是两者兼而有之?
如果我们在 LSTM 之后添加它,并且因为
return_sequences是False,那么 dropout 在这里做什么?LSTM中的dropout选项和LSTM层之前的dropout层有什么不同吗?
【问题讨论】:
标签: tensorflow keras lstm dropout