Mercurial > ift6266
comparison deep/crbm/mnist_config.py.example @ 340:523e7b87c521
Corrected a few bugs, no new features. Supposedly ready to run on cluster.
author | fsavard |
---|---|
date | Sun, 18 Apr 2010 11:39:24 -0400 |
parents | ffbf0e41bcee |
children | 74287f0371bf |
comparison
equal
deleted
inserted
replaced
339:ffbf0e41bcee | 340:523e7b87c521 |
---|---|
1 # ---------------------------------------------------------------------------- | 1 # ---------------------------------------------------------------------------- |
2 # BEGIN EXPERIMENT ISOLATION CODE | 2 # BEGIN EXPERIMENT ISOLATION CODE |
3 | 3 |
4 ''' | 4 def isolate_experiment(): |
5 This makes sure we use the codebase clone created for this experiment. | 5 ''' |
6 I.e. if you want to make modifications to the codebase but don't want your | 6 This makes sure we use the codebase clone created for this experiment. |
7 running experiment code to be impacted by those changes, first copy the | 7 I.e. if you want to make modifications to the codebase but don't want your |
8 codebase somewhere, and configure this section. It will make sure we import | 8 running experiment code to be impacted by those changes, first copy the |
9 from the right place. | 9 codebase somewhere, and configure this section. It will make sure we import |
10 from the right place. | |
10 | 11 |
11 MUST BE DONE BEFORE IMPORTING ANYTHING ELSE | 12 MUST BE DONE BEFORE IMPORTING ANYTHING ELSE |
12 (Leave this comment there so others will understand what's going on) | 13 (Leave this comment there so others will understand what's going on) |
13 ''' | 14 ''' |
14 | 15 |
15 # Place where you copied modules that should be frozen for this experiment | 16 # 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 codebase_clone_path = "/u/savardf/ift6266/experiment_clones/ift6266_mnistcrbm_exp1" |
17 | 18 |
18 # Places where there might be conflicting modules from your $PYTHONPATH | 19 # Places where there might be conflicting modules from your $PYTHONPATH |
19 remove_these_from_pythonpath = ["/u/savardf/ift6266/dev_code"] | 20 remove_these_from_pythonpath = ["/u/savardf/ift6266/dev_code"] |
20 | 21 |
21 import sys | 22 import sys |
22 sys.path[0:0] = [codebase_clone_path] | 23 sys.path[0:0] = [codebase_clone_path] |
23 | 24 |
24 # remove paths we specifically don't want in $PYTHONPATH | 25 # remove paths we specifically don't want in $PYTHONPATH |
25 for bad_path in remove_these_from_pythonpath: | 26 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 sys.path[:] = [el for el in sys.path if not el in (bad_path, bad_path+"/")] |
27 | 28 |
28 # Make the imports | 29 # Make the imports |
29 import ift6266 | 30 import ift6266 |
30 | 31 |
31 # Just making sure we're importing from the right place | 32 # Just making sure we're importing from the right place |
32 modules_to_check = [ift6266] | 33 modules_to_check = [ift6266] |
33 for module in modules_to_check: | 34 for module in modules_to_check: |
34 if not codebase_clone_path in module.__path__[0]: | 35 if not codebase_clone_path in module.__path__[0]: |
35 raise RuntimeError("Module loaded from incorrect path "+module.__path__[0]) | 36 raise RuntimeError("Module loaded from incorrect path "+module.__path__[0]) |
36 | 37 |
37 # Path to pass to jobman sqlschedule. IMPORTANT TO CHANGE TO REFLECT YOUR CLONE. | 38 # 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 # Make sure this is accessible from the default $PYTHONPATH (in your .bashrc) |
39 # (and make sure every subdirectory has its __init__.py file) | 40 # (and make sure every subdirectory has its __init__.py file) |
40 EXPERIMENT_PATH = "ift6266_mnistcrbm_exp1.ift6266.deep.crbm.mnist_crbm.jobman_entrypoint" | 41 EXPERIMENT_PATH = "ift6266_mnistcrbm_exp1.ift6266.deep.crbm.mnist_crbm.jobman_entrypoint" |
41 | 42 |
42 # END EXPERIMENT ISOLATION CODE | 43 # END EXPERIMENT ISOLATION CODE |
43 # ---------------------------------------------------------------------------- | 44 # ---------------------------------------------------------------------------- |
44 | 45 |
45 from jobman import DD | 46 from jobman import DD |
51 DON'T add the renamed file to the repository, as others might use it | 52 DON'T add the renamed file to the repository, as others might use it |
52 without realizing it, with dire consequences. | 53 without realizing it, with dire consequences. |
53 ''' | 54 ''' |
54 | 55 |
55 # change "sandbox" when you're ready | 56 # change "sandbox" when you're ready |
56 JOBDB = 'postgres://ift6266h10@gershwin/ift6266h10_db/fsavard_mnistcrbm_exp1' | 57 JOBDB = 'postgres://ift6266h10@gershwin/ift6266h10_sandbox_db/yourtablenamehere' |
57 | 58 |
58 # Set this to True when you want to run cluster tests, ie. you want | 59 # 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 # 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 # set size and the number of epochs, so you know everything runs |
61 # fine on the cluster. | 62 # fine on the cluster. |
74 SERIES_STDOUT_TOO = False | 75 SERIES_STDOUT_TOO = False |
75 | 76 |
76 VISUALIZE_EVERY = 20000 | 77 VISUALIZE_EVERY = 20000 |
77 GIBBS_STEPS_IN_VIZ_CHAIN = 1000 | 78 GIBBS_STEPS_IN_VIZ_CHAIN = 1000 |
78 | 79 |
80 if TEST_CONFIG: | |
81 REDUCE_EVERY = 10 | |
82 VISUALIZE_EVERY = 20 | |
83 | |
79 # This is to configure insertion of jobs on the cluster. | 84 # This is to configure insertion of jobs on the cluster. |
80 # Possible values the hyperparameters can take. These are then | 85 # Possible values the hyperparameters can take. These are then |
81 # combined with produit_cartesien_jobs so we get a list of all | 86 # combined with produit_cartesien_jobs so we get a list of all |
82 # possible combinations, each one resulting in a job inserted | 87 # possible combinations, each one resulting in a job inserted |
83 # in the jobman DB. | 88 # in the jobman DB. |
84 JOB_VALS = {'learning_rate': [1.0, 0.1, 0.01], | 89 JOB_VALS = {'learning_rate': [1.0, 0.1, 0.01], |
85 'sparsity_lambda': [3.0,0.5], | 90 'sparsity_lambda': [3.0,0.5], |
86 'sparsity_p': [0.3,0.05], | 91 'sparsity_p': [0.3,0.05], |
87 'num_filters': [40,15], | 92 'num_filters': [40,15], |
88 'filter_size': [12,7], | 93 'filter_size': [12,7], |
89 'minibatch_size': [20]} | 94 'minibatch_size': [20], |
95 'num_epochs': [20]} | |
90 | 96 |
91 # Just useful for tests... minimal number of epochs | 97 # Just useful for tests... minimal number of epochs |
92 # Useful when launching a single local job | 98 # Useful when launching a single local job |
93 DEFAULT_STATE = DD({'learning_rate': 0.1, | 99 DEFAULT_STATE = DD({'learning_rate': 0.1, |
94 'sparsity_lambda': 1.0, | 100 'sparsity_lambda': 1.0, |
95 'sparsity_p': 0.05, | 101 'sparsity_p': 0.05, |
96 'num_filters': 40, | 102 'num_filters': 40, |
97 'filter_size': 12, | 103 'filter_size': 12, |
98 'minibatch_size': 10}) | 104 'minibatch_size': 10, |
105 'num_epochs': 20}) | |
99 | 106 |
100 # To reinsert duplicate of jobs that crashed | 107 # To reinsert duplicate of jobs that crashed |
101 REINSERT_COLS = ['learning_rate','sparsity_lambda','sparsity_p','num_filters','filter_size','minibatch_size','dupe'] | 108 REINSERT_COLS = ['learning_rate','sparsity_lambda','sparsity_p','num_filters','filter_size','minibatch_size','dupe'] |
102 #REINSERT_JOB_VALS = [\ | 109 #REINSERT_JOB_VALS = [\ |
103 # [,2],] | 110 # [,2],] |