时空2D-CNN-LSTM

时间:2019-10-01 06:29:26

标签: time-series conv-neural-network lstm recurrent-neural-network

火车输入形状:(13974,100,6,5) 火车输出形状:(13974,1,6,5) 测试输入形状:(3494,100,6,5) 测试输出形状:(3494,1,6,5)

model = Sequential()
model.add(TimeDistributed(Conv2D(32, (3, 3), 
padding='same'), 
input_shape=(100, 6, 5,1)))
model.add(TimeDistributed(Activation('relu')))
model.add(TimeDistributed(Conv2D(32, (3, 3))))
model.add(TimeDistributed(Activation('relu')))
model.add(TimeDistributed(MaxPooling2D(pool_size=(2, 2))))
model.add(TimeDistributed(Dropout(0.25)))

model.add(TimeDistributed(Flatten()))
model.add(TimeDistributed(Dense(512)))

model.add(TimeDistributed(Dense(35, name="first_dense_flow" )))

model.add(LSTM(20, return_sequences=True, name="lstm_layer_flow"));    
model.add(TimeDistributed(Dense(101), name=" time_distr_dense_one_ flow ")) 

model.add(GlobalAveragePooling1D(name="global_avg_flow"))
model.compile(loss='mae', optimizer='adam', metrics=['accuracy'])    model.fit(train_input,train_output,epochs=50,batch_size=60)

我正在尝试建立一个能够检测未来的CNN-LSTM模型。输入是13974序列,每个序列包含100个时间戳,每个时间戳包含6个位置和5个特征(变量),因此输入是(13974,100,6,5),输出是(13974,1,6,5)

如何更改模型,以便可以进行时空预测

0 个答案:

没有答案