comparison deep/stacked_dae/config.py.example @ 275:7b4507295eba

merge
author Xavier Glorot <glorotxa@iro.umontreal.ca>
date Mon, 22 Mar 2010 10:20:10 -0400
parents b077d9e97a3b
children 43afd29f3dbd
comparison
equal deleted inserted replaced
274:44409b6652aa 275:7b4507295eba
1 # ----------------------------------------------------------------------------
2 # BEGIN EXPERIMENT ISOLATION CODE
3
4 '''
5 This makes sure we use the codebase clone created for this experiment.
6 I.e. if you want to make modifications to the codebase but don't want your
7 running experiment code to be impacted by those changes, first copy the
8 codebase somewhere, and configure this section. It will make sure we import
9 from the right place.
10
11 MUST BE DONE BEFORE IMPORTING ANYTHING ELSE
12 (Leave this comment there so others will understand what's going on)
13 '''
14
15 # Place where you copied modules that should be fixed for this experiment
16 codebase_clone_path = "/u/savardf/ift6266/experiment_clones/ift6266_experiment10"
17
18 # Places where there might be conflicting modules from your $PYTHONPATH
19 remove_these_from_pythonpath = ["/u/savardf/ift6266/dev_code"]
20
21 import sys
22 sys.path[0:0] = [codebase_clone_path]
23
24 # remove paths we specifically don't want in $PYTHONPATH
25 for bad_path in remove_these_from_pythonpath:
26 sys.path[:] = [el for el in sys.path if not el in (bad_path, bad_path+"/")]
27
28 # Make the imports
29 import ift6266
30
31 # Just making sure we're importing from the right place
32 modules_to_check = [ift6266]
33 for module in modules_to_check:
34 if not codebase_clone_path in module.__path__[0]:
35 raise RuntimeError("Module loaded from incorrect path "+module.__path__[0])
36
37 # Path to pass to jobman sqlschedule. IMPORTANT TO CHANGE TO REFLECT YOUR CLONE.
38 # Make sure this is accessible from the default $PYTHONPATH (in your .bashrc)
39 # (and make sure every subdirectory has its __init__.py file)
40 EXPERIMENT_PATH = "ift6266_experiment10.ift6266.deep.stacked_dae.nist_sda.jobman_entrypoint"
41
42 # END EXPERIMENT ISOLATION CODE
43 # ----------------------------------------------------------------------------
44
45 from jobman import DD
46
47 '''
48 These are parameters used by nist_sda.py. They'll end up as globals in there.
49
50 Rename this file to config.py and configure as needed.
51 DON'T add the renamed file to the repository, as others might use it
52 without realizing it, with dire consequences.
53 '''
54
55 # Set this to True when you want to run cluster tests, ie. you want
56 # to run on the cluster, many jobs, but want to reduce the training
57 # set size and the number of epochs, so you know everything runs
58 # fine on the cluster.
59 # Set this PRIOR to inserting your test jobs in the DB.
60 TEST_CONFIG = False
61
62 NIST_ALL_LOCATION = '/data/lisa/data/nist/by_class/all'
63 NIST_ALL_TRAIN_SIZE = 649081
64 # valid et test =82587 82587
65
66 # change "sandbox" when you're ready
67 JOBDB = 'postgres://ift6266h10@gershwin/ift6266h10_sandbox_db/yourtablenamehere'
68
69 # reduce training set to that many examples
70 REDUCE_TRAIN_TO = None
71 # that's a max, it usually doesn't get to that point
72 MAX_FINETUNING_EPOCHS = 1000
73 # number of minibatches before taking means for valid error etc.
74 REDUCE_EVERY = 100
75
76 if TEST_CONFIG:
77 REDUCE_TRAIN_TO = 1000
78 MAX_FINETUNING_EPOCHS = 2
79 REDUCE_EVERY = 10
80
81
82 # This is to configure insertion of jobs on the cluster.
83 # Possible values the hyperparameters can take. These are then
84 # combined with produit_cartesien_jobs so we get a list of all
85 # possible combinations, each one resulting in a job inserted
86 # in the jobman DB.
87 JOB_VALS = {'pretraining_lr': [0.1, 0.01],#, 0.001],#, 0.0001],
88 'pretraining_epochs_per_layer': [10,20],
89 'hidden_layers_sizes': [300,800],
90 'corruption_levels': [0.1,0.2,0.3],
91 'minibatch_size': [20],
92 'max_finetuning_epochs':[MAX_FINETUNING_EPOCHS],
93 'finetuning_lr':[0.1, 0.01], #0.001 was very bad, so we leave it out
94 'num_hidden_layers':[2,3]}
95
96 # Just useful for tests... minimal number of epochs
97 # (This is used when running a single job, locally, when
98 # calling ./nist_sda.py test_jobman_entrypoint
99 DEFAULT_HP_NIST = DD({'finetuning_lr':0.1,
100 'pretraining_lr':0.1,
101 'pretraining_epochs_per_layer':2,
102 'max_finetuning_epochs':2,
103 'hidden_layers_sizes':800,
104 'corruption_levels':0.2,
105 'minibatch_size':20,
106 'reduce_train_to':10000,
107 'num_hidden_layers':1})
108
109