Is there a way to setup ConvLSTM2D model to input and output dataset with different timesteps?

Viewed 9

I am trying to set up a ConvLSTM2D architecture that takes as input and output the data with the following shapes:

Input shape: (1000, 10, 100, 100, 1)

Output shape: (1000, 5, 100, 100, 1)

As you can notice, the difference between these input and output shapes are timesteps. Is there any way I can set up such an architecture?

The following is the one that I am using right now, which doesn't allow me to specify input / output timesteps separately.

inputs = layers.Input(shape=(None, x_train.shape[2], x_train.shape[2], 1 ))

x = layers.ConvLSTM2D(filters=64, kernel_size=(5,5), padding="same", return_sequences=True, activation="relu")(inputs)
x = layers.BatchNormalization()(x)
x = layers.ConvLSTM2D(filters=64, kernel_size=(3,3), padding="same", return_sequences=True, activation="relu")(x)
x = layers.BatchNormalization()(x)
x = layers.ConvLSTM2D(filters=64, kernel_size=(1,1), padding="same", return_sequences=True, activation="relu")(x)

outputs = layers.Conv3D(filters=1, kernel_size=(3,3,3), activation="sigmoid", padding="same")(x)

model = keras.models.Model(inputs, outputs)
model.compile(loss=keras.losses.binary_crossentropy, optimizer=keras.optimizers.Adam())

model.summary()

Appreciate any help!

0 Answers
Related