我的数据是(83,104)pandas数据帧。我的第一个(唯一)隐藏层预计会有5个神经元。
当我写这样的代码时:
input_img = Input(shape=(104,)) # 104 dates as variable
encoded = Dense(5, activation='relu')(input_img)
decoded = Dense(104, activation='relu')(encoded)
autoencoder = Model(input_img, decoded)
autoencoder.compile(loss='mean_squared_error', optimizer='sgd')
autoencoder.fit(train_data, train_data, epochs=50)
我收到错误消息:
ValueError: Shape mismatch: x has 32 cols (and 83 rows) but y has 104 rows (and 5 cols)
Apply node that caused the error: Dot22(/input_24, dense_47/kernel)
Toposort index: 2
Inputs types: [TensorType(float32, matrix), TensorType(float32, matrix)]
Inputs shapes: [(83, 32), (104, 5)]
Inputs strides: [(4, 332), (20, 4)]
我遵循了https://blog.keras.io/building-autoencoders-in-keras.html的指导。
有谁知道这里有什么问题?
谢谢,