我是深度学习领域的新手,并且愿意为具有以下形状的时间序列构建Conv1D自动编码器:
我不确定如何设置参数: filters,kernel_size 和 MaxPooling1D 层(行为是什么?), Flatten (行为是什么?),以及如何在架构上设计最简单的Conv1D自动编码器。
我试图独自收集一些东西,但是我的版本根本无法使用:
input_layer = Input(shape=(TIMESTEPS, feature_size))
# ENCODER
x = Conv1D(filters=encoding_dim, kernel_size=TIMESTEPS, activation='relu', padding='valid')(input_layer)
x1 = MaxPooling1D(poolsize=TIMESTEPS)(x)
flat = Flatten()(x1)
encoded = Dense(units=encoding_dim, activation = 'relu')(flat)
print("shape of encoded {}".format(K.int_shape(encoded)))
# DECODER
x_ = Conv1D(encoding_dim, TIMESTEPS, activation='relu', padding='valid')(encoded)
upsamp = UpSampling1D(TIMESTEPS)(x_)
flat = Flatten()(upsamp)
decoded = Dense(units=feature_size, activation = 'relu')(flat)
decoded = Reshape((TIMESTEPS, feature_size))(decoded)
print("shape of decoded {}".format(K.int_shape(decoded)))
autoencoder = Model(input_layer, decoded)
ValueError:输入尺寸为[?,1,1,59]的'max_pooling1d / MaxPool'(op:'MaxPool')从1中减去23导致的负尺寸大小。