简体   繁体   English

Keras自动编码器的精度/损耗不变

[英]Keras autoencoder accuracy/loss doesn't change

Here is my code: 这是我的代码:

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 has a shape (537621, 256). X具有形状(537621,256)。 I'm trying to find a way to compress the vectors of size 256 to 100, then to 70, then to 50. I have done this is Lasagne but in Keras it seems to be easier to work w/ Autoencoders. 我正在尝试找到一种方法来将大小为256的向量压缩为100,然后压缩为70,然后压缩为50。我这样做的方法是千层面,但在Keras中,使用自动编码器似乎更容易工作。

Here is the output: 这是输出:

Epoch 1/500 537621/537621 [==============================] - 27s - loss: 0.1339 - acc: 0.0036 时代1/500 537621/537621 [==============================]-27秒-损失:0.1339-累计:0.0036
Epoch 2/500 537621/537621 [==============================] - 32s - loss: 0.1339 - acc: 0.0036 时代2/500 537621/537621 [==============================]-32秒-损失:0.1339-累计:0.0036
Epoch 3/500 252336/537621 [=============>................] - ETA: 14s - loss: 0.1339 - acc: 0.0035 时代3/500 252336/537621 [============> ................]-ETA:14秒-损失:0.1339-acc: 0.0035

And it continues like this on and on.. 并持续不断地如此。

现在它已在master上修复:)有时打开问题有时是最好的选择https://github.com/fchollet/keras/issues/1604

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM