comparison deep/convolutional_dae/run_exp.py @ 333:69109e41983e

Adapt parameters (especially the number of epochs) to P07
author Arnaud Bergeron <abergeron@gmail.com>
date Wed, 14 Apr 2010 16:06:04 -0400
parents 6eab220a7d70
children 01445a75c702
comparison
equal deleted inserted replaced
332:5b260cc8f477 333:69109e41983e
1 from ift6266.deep.convolutional_dae.scdae import * 1 from ift6266.deep.convolutional_dae.scdae import *
2 2
3 class dumb(object): 3 class dumb(object):
4 COMPLETE = None
4 def save(self): 5 def save(self):
5 pass 6 pass
6 7
7 def go(state, channel): 8 def go(state, channel):
8 from ift6266 import datasets 9 from ift6266 import datasets
16 17
17 pylearn.version.record_versions(state, [theano, ift6266, pylearn]) 18 pylearn.version.record_versions(state, [theano, ift6266, pylearn])
18 # TODO: maybe record pynnet version? 19 # TODO: maybe record pynnet version?
19 channel.save() 20 channel.save()
20 21
21 dset = datasets.nist_all() 22 dset = datasets.nist_P07()
22 23
23 nfilts = [] 24 nfilts = []
24 if state.nfilts1 != 0: 25 if state.nfilts1 != 0:
25 nfilts.append(state.nfilts1) 26 nfilts.append(state.nfilts1)
26 if state.nfilts2 != 0: 27 if state.nfilts2 != 0:
59 do_pretrain(pretrain_fs, state.pretrain_rounds, series['recons_error']) 60 do_pretrain(pretrain_fs, state.pretrain_rounds, series['recons_error'])
60 61
61 print "training ..." 62 print "training ..."
62 sys.stdout.flush() 63 sys.stdout.flush()
63 best_valid, test_score = sgd_opt(train, valid, test, 64 best_valid, test_score = sgd_opt(train, valid, test,
64 training_epochs=1000000, patience=2500, 65 training_epochs=800000, patience=2000,
65 patience_increase=2., 66 patience_increase=2.,
66 improvement_threshold=0.995, 67 improvement_threshold=0.995,
67 validation_frequency=500, 68 validation_frequency=500,
68 series=series, net=net) 69 series=series, net=net)
69 state.best_valid = best_valid 70 state.best_valid = best_valid