这是我的代码:
AE_0 = Sequential()
encoder = Sequential([Dense(output_dim=100, input_dim=256, activation='sigmoid')])
decoder = Sequential([Dense(output_dim=256, input_dim=100, activation='linear')])
AE_0.add(AutoEncoder(encoder=encoder, decoder=decoder, output_reconstruction=True))
AE_0.compile(loss='mse', optimizer=SGD(lr=0.03, momentum=0.9, decay=0.001, nesterov=True))
AE_0.fit(X, X, batch_size=21, nb_epoch=500, show_accuracy=True)
X具有形状(537621,256)。我试图找到一种方法来压缩大小为256到100,然后到70,然后到50的向量。我做的是烤宽面条,但在Keras中,使用自动编码器工作似乎更容易。
这是输出:
大纪元1/500
537621/537621 [==============================] - 27s - 损失:0.1339 - acc:0.0036
大纪元2/500
537621/537621 [==============================] - 32s - 损失:0.1339 - acc:0.0036
大纪元3/500
252336/537621 [=============> ................] - ETA:14s - 损失:0.1339 - acc:0.0035
它继续像这样继续......