mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

mxnet/example/autoencoder/mnist_sae.py not converge with the specified parameters

Open p2004r opened this issue 9 years ago • 1 comments

Version of the code with the working parameters

Please fix this part of the example!

# pylint: skip-file
from __future__ import print_function
import mxnet as mx
import numpy as np
import logging
import data
from autoencoder import AutoEncoderModel


if __name__ == '__main__':
    # set to INFO to see less information during training
    logging.basicConfig(level=logging.DEBUG)

ae_model = AutoEncoderModel(mx.gpu(0), [784,500,300,150,10], pt_dropout=0.3,
        internal_act='relu', output_act='relu')

X, _ = data.get_mnist()
train_X = X[:60000]
val_X = X[60000:]

ae_model.layerwise_pretrain(train_X, 256, 150000, 'sgd', l_rate=0.001, decay=0.0,
                             lr_scheduler=mx.misc.FactorScheduler(20000,0.7))
ae_model.finetune(train_X, 256, 100000, 'sgd', l_rate=0.001, decay=0.0,
                   lr_scheduler=mx.misc.FactorScheduler(20000,0.6))
ae_model.save('mnist_pt.arg')
ae_model.load('mnist_pt.arg')
print("Training error:", ae_model.eval(train_X))
print("Validation error:", ae_model.eval(val_X))

p2004r avatar Jan 11 '17 17:01 p2004r

This issue is closed due to lack of activity in the last 90 days. Feel free to reopen if this is still an active issue. Thanks!

yajiedesign avatar Sep 28 '17 08:09 yajiedesign