# HG changeset patch # User James Bergstra # Date 1283965502 14400 # Node ID 7bb5dd98e671036f43a86c0451b6d3ee75ba76f2 # Parent ba25c6e4f55de7e30c72233592a907c93b924ddf mcRBM - added hack to main script to pickle final model and sampler diff -r ba25c6e4f55d -r 7bb5dd98e671 pylearn/algorithms/mcRBM.py --- a/pylearn/algorithms/mcRBM.py Sat Sep 04 19:32:27 2010 -0400 +++ b/pylearn/algorithms/mcRBM.py Wed Sep 08 13:05:02 2010 -0400 @@ -561,4 +561,10 @@ if __name__ == '__main__': import pylearn.algorithms.tests.test_mcRBM - pylearn.algorithms.tests.test_mcRBM.test_reproduce_ranzato_hinton_2010(as_unittest=True) + rbm,smplr = pylearn.algorithms.tests.test_mcRBM.test_reproduce_ranzato_hinton_2010( + as_unittest=False, + n_train_iters=10) + import cPickle + cPickle.dump(rbm, open('mcRBM.rbm.pkl', 'w'), -1) + cPickle.dump(smplr, open('mcRBM.smplr.pkl', 'w'), -1) + diff -r ba25c6e4f55d -r 7bb5dd98e671 pylearn/algorithms/tests/test_mcRBM.py --- a/pylearn/algorithms/tests/test_mcRBM.py Sat Sep 04 19:32:27 2010 -0400 +++ b/pylearn/algorithms/tests/test_mcRBM.py Wed Sep 08 13:05:02 2010 -0400 @@ -1,6 +1,6 @@ from pylearn.algorithms.mcRBM import * -def test_reproduce_ranzato_hinton_2010(dataset='MAR', as_unittest=True): +def test_reproduce_ranzato_hinton_2010(dataset='MAR', as_unittest=True, n_train_iters=5000): dataset='MAR' if dataset == 'MAR': n_vis=105 @@ -10,8 +10,6 @@ n_vis=R*C n_patches=100000 - n_train_iters=5000 - n_burnin_steps=10000 @@ -137,3 +135,5 @@ print "Activating L1 weight decay" effective_l1_penalty = 1e-3 + if not as_unittest: + return rbm, smplr