我有一个疑问。
我有2个CNN + LSTM模型,它们的输出相同。summary()
第一个(1D):
model_cnn_lstm1D = Sequential()
model_cnn_lstm1D.add(TimeDistributed(Convolution1D(32, 3, padding='same', strides=1, activation='relu'), input_shape = (2,n_columns,1)))
model_cnn_lstm1D.add(TimeDistributed(Convolution1D(32, 3, padding='same', strides=2, activation='relu')))
model_cnn_lstm1D.add(TimeDistributed(MaxPooling1D(pool_size=3)))
...
model_cnn_lstm1D.add(TimeDistributed(Flatten()))
model_cnn_lstm1D.add(LSTM(1024, activation='relu'))
model_cnn_lstm1D.add(Dense(3)) # default linear activation
第二个(2D):
model_cnn_lstm2D = Sequential()
model_cnn_lstm2D.add(Convolution2D(32, (1, 3), strides=(1,1), padding = 'same', activation='relu', input_shape=(2,n_columns,1)))
model_cnn_lstm2D.add(Convolution2D(32, (1, 3), strides=(1,2), padding = 'same', activation='relu'))
model_cnn_lstm2D.add(MaxPooling2D(pool_size=(1,3)))
...
model_cnn_lstm2D.add(TimeDistributed(Flatten()))
model_cnn_lstm2D.add(LSTM(1024, activation='relu'))
model_cnn_lstm2D.add(Dense(3)) # default linear activation
如您所见,模型的第二部分完全相同。
问题是这两个NN在概念上是相同的吗?为什么? 谢谢!