comparison deep/crbm/mnist_config.py.example @ 339:ffbf0e41bcee

Aded code to run experiment on cluster, separate configuration from other machinery. Not tested yet.
author fsavard
date Sat, 17 Apr 2010 20:29:18 -0400
parents
children 523e7b87c521
comparison
equal deleted inserted replaced
338:fca22114bb23 339:ffbf0e41bcee
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 frozen for this experiment
16 codebase_clone_path = "/u/savardf/ift6266/experiment_clones/ift6266_mnistcrbm_exp1"
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_mnistcrbm_exp1.ift6266.deep.crbm.mnist_crbm.jobman_entrypoint"
41
42 # END EXPERIMENT ISOLATION CODE
43 # ----------------------------------------------------------------------------
44
45 from jobman import DD
46
47 '''
48 These are parameters used by mnist_crbm.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 # change "sandbox" when you're ready
56 JOBDB = 'postgres://ift6266h10@gershwin/ift6266h10_db/fsavard_mnistcrbm_exp1'
57
58 # Set this to True when you want to run cluster tests, ie. you want
59 # to run on the cluster, many jobs, but want to reduce the training
60 # set size and the number of epochs, so you know everything runs
61 # fine on the cluster.
62 # Set this PRIOR to inserting your test jobs in the DB.
63 TEST_CONFIG = False
64
65 # save params at training end
66 SAVE_PARAMS = True
67
68 IMAGE_OUTPUT_DIR = 'img/'
69
70 # number of minibatches before taking means for valid error etc.
71 REDUCE_EVERY = 100
72
73 # print series to stdout too (otherwise just produce the HDF5 file)
74 SERIES_STDOUT_TOO = False
75
76 VISUALIZE_EVERY = 20000
77 GIBBS_STEPS_IN_VIZ_CHAIN = 1000
78
79 # This is to configure insertion of jobs on the cluster.
80 # Possible values the hyperparameters can take. These are then
81 # combined with produit_cartesien_jobs so we get a list of all
82 # possible combinations, each one resulting in a job inserted
83 # in the jobman DB.
84 JOB_VALS = {'learning_rate': [1.0, 0.1, 0.01],
85 'sparsity_lambda': [3.0,0.5],
86 'sparsity_p': [0.3,0.05],
87 'num_filters': [40,15],
88 'filter_size': [12,7],
89 'minibatch_size': [20]}
90
91 # Just useful for tests... minimal number of epochs
92 # Useful when launching a single local job
93 DEFAULT_STATE = DD({'learning_rate': 0.1,
94 'sparsity_lambda': 1.0,
95 'sparsity_p': 0.05,
96 'num_filters': 40,
97 'filter_size': 12,
98 'minibatch_size': 10})
99
100 # To reinsert duplicate of jobs that crashed
101 REINSERT_COLS = ['learning_rate','sparsity_lambda','sparsity_p','num_filters','filter_size','minibatch_size','dupe']
102 #REINSERT_JOB_VALS = [\
103 # [,2],]
104