Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

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

Closed
p2004r opened this issue Jan 11, 2017 · 1 comment

Comments

@p2004r
Copy link

p2004r commented Jan 11, 2017

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))

@yajiedesign
Copy link
Contributor

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants