diff deep/stacked_dae/nist_sda.py @ 278:43afd29f3dbd

Ajouté fonctionnalité pour réinsérer de nouvelles jobs aux paramètres choisis manuellement, en liste, pour repartir des jobs spécifiques qui ont crashé
author fsavard
date Wed, 24 Mar 2010 14:35:11 -0400
parents b077d9e97a3b
children 206374eed2fb
line wrap: on
line diff
--- a/deep/stacked_dae/nist_sda.py	Fri Mar 19 11:31:57 2010 -0400
+++ b/deep/stacked_dae/nist_sda.py	Wed Mar 24 14:35:11 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)