i'm still learning in LSTM classification.
(我仍在学习LSTM分类。)
my input dataset is (2386, 3) where (n_rows, n_predictive)
my output dataset is (2386, 7) where (n_rows, n_label)
my input windows size is (2369, 12, 3) where (n_sample, n_input, n_predictive)
my output windows size is (2369, 6, 7) where (n_sample, n_output, n_label)
using this code
model = Sequential()
model.add(LSTM(300, return_sequences=True, input_shape=(n_input, n_predictive)))
model.add(TimeDistributed(Dense(n_label)))
model.add(Activation('softmax'))
model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['acc'])
obtain this layer
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
cu_dnnlstm_93 (CuDNNLSTM) (None, 12, 300) 363600
_________________________________________________________________
time_distributed_14 (TimeDis (None, 12, 7) 2107
_________________________________________________________________
activation_13 (Activation) (None, 12, 7) 0
=================================================================
and its error
(及其错误)
Error when checking target: expected activation_13 to have shape (12, 7) but got array with shape (6, 7)
I try to create the layer but I'm unable to create layer with (None, 6, 7) , do you guys have any suggestion on how I can create layer with (None, 6, 7)?
(我尝试创建图层,但是无法使用(None,6,7)创建图层,你们对我如何使用(None,6,7)创建图层有任何建议吗?)
update (更新)
when I try to fit the model with the same input and output windows, as below
(当我尝试使用相同的输入和输出窗口来拟合模型时,如下所示)
input windows size is (2369, 12, 3)
output windows size is (2369, 12, 7)
the model does not have error BUT, I found out that the label prediction give 12 step late than the actual.
(该模型没有错误,但我发现标签预测比实际延迟了12步。)
when I use different windows size for example
(例如,当我使用其他窗口大小时)
input windows size is (2369, 6, 3)
output windows size is (2369, 6, 7)
I found out that the label prediction give 6 step late than the actual.
(我发现标签预测比实际延迟了6个步骤。)
I already checked windows split sequence function where I follow this code from this blog https://machinelearningmastery.com/how-to-develop-lstm-models-for-time-series-forecasting/
(我已经检查了Windows拆分序列功能,在这里我遵循此博客https://machinelearningmastery.com/how-to-develop-lstm-models-for-time-series-forecasting/中的代码)
the windows split is just working fine.
(窗户分开工作正常。)
But it seem that the LSTM model working weird. (但是似乎LSTM模型工作异常。)
Does the LSTM model for classification are affected with the windows size? (LSTM分类模型是否会受到窗口大小的影响?)
ask by lemon93 translate from so