changeset 279:206374eed2fb

Merge
author fsavard
date Wed, 24 Mar 2010 14:36:55 -0400
parents 43afd29f3dbd (diff) 20ebc1f2a9fe (current diff)
children c77ffb11f91d 8a3af19ae272
files deep/stacked_dae/nist_sda.py deep/stacked_dae/utils.py
diffstat 3 files changed, 33 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/deep/stacked_dae/config.py.example	Mon Mar 22 16:37:34 2010 -0400
+++ b/deep/stacked_dae/config.py.example	Wed Mar 24 14:36:55 2010 -0400
@@ -106,4 +106,11 @@
                        'reduce_train_to':10000,
                        'num_hidden_layers':1})
 
+# To reinsert duplicate of jobs that crashed
+REINSERT_COLS = ['pretraining_lr','pretraining_epochs_per_layer','hidden_layers_sizes','corruption_levels','minibatch_size','max_finetuning_epochs','finetuning_lr','num_hidden_layers','dupe']
+REINSERT_JOB_VALS = [\
+            [0.1,10,800,0.3,20,1000,0.01,3,2],
+            [0.1,10,800,0.4,20,1000,0.01,3,2],
+            [0.1,10,800,0.3,20,1000,0.005,3,2],
+            [0.1,10,800,0.6,20,1000,0.005,3,2]]
 
--- a/deep/stacked_dae/nist_sda.py	Mon Mar 22 16:37:34 2010 -0400
+++ b/deep/stacked_dae/nist_sda.py	Wed Mar 24 14:36:55 2010 -0400
@@ -24,7 +24,7 @@
 import jobman, jobman.sql
 from pylearn.io import filetensor
 
-from utils import produit_cartesien_jobs
+from utils import produit_cartesien_jobs, jobs_from_reinsert_list
 
 from sgd_optimization import SdaSgdOptimizer
 
@@ -152,6 +152,18 @@
 
     print "inserted"
 
+def jobman_REinsert_nist():
+    jobs = jobs_from_reinsert_list(REINSERT_COLS, REINSERT_JOB_VALS)
+
+    db = jobman.sql.db(JOBDB)
+    for job in jobs:
+        job.update({jobman.sql.EXPERIMENT: EXPERIMENT_PATH})
+        jobman.sql.insert_dict(job, db)
+
+    print "reinserted"
+
+
+
 if __name__ == '__main__':
 
     args = sys.argv[1:]
@@ -162,6 +174,9 @@
     if len(args) > 0 and args[0] == 'jobman_insert':
         jobman_insert_nist()
 
+    if len(args) > 0 and args[0] == 'reinsert':
+        jobman_REinsert_nist()
+
     elif len(args) > 0 and args[0] == 'test_jobman_entrypoint':
         chanmock = DD({'COMPLETE':0,'save':(lambda:None)})
         jobman_entrypoint(DEFAULT_HP_NIST, chanmock)
--- a/deep/stacked_dae/utils.py	Mon Mar 22 16:37:34 2010 -0400
+++ b/deep/stacked_dae/utils.py	Wed Mar 24 14:36:55 2010 -0400
@@ -41,6 +41,16 @@
     print produit_cartesien_jobs(vals)
 
 
+def jobs_from_reinsert_list(cols, job_vals):
+    job_list = []
+    for vals in job_vals:
+        job = DD()
+        for i, col in enumerate(cols):
+            job[col] = vals[i]
+        job_list.append(job)
+
+    return job_list
+
 # taken from http://stackoverflow.com/questions/276052/how-to-get-current-cpu-and-ram-usage-in-python
 """Simple module for getting amount of memory used by a specified user's
 processes on a UNIX system.