changeset 268:b077d9e97a3b

Légères corrections à config.py.example et ajusté nist_sda pour utiliser la nouvelle 'interface' des datasets (nist_all()).
author fsavard
date Fri, 19 Mar 2010 11:31:57 -0400
parents 798d1344e6a2
children 4533350d7361 43afd29f3dbd
files deep/stacked_dae/config.py.example deep/stacked_dae/nist_sda.py
diffstat 2 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/deep/stacked_dae/config.py.example	Fri Mar 19 11:12:40 2010 -0400
+++ b/deep/stacked_dae/config.py.example	Fri Mar 19 11:31:57 2010 -0400
@@ -23,7 +23,7 @@
 
 # remove paths we specifically don't want in $PYTHONPATH
 for bad_path in remove_these_from_pythonpath:
-    sys.path[:] = [el for el in sys.path if not el (bad_path, bad_path+"/")]
+    sys.path[:] = [el for el in sys.path if not el in (bad_path, bad_path+"/")]
 
 # Make the imports
 import ift6266
@@ -31,15 +31,19 @@
 # Just making sure we're importing from the right place
 modules_to_check = [ift6266]
 for module in modules_to_check:
-    assert codebase_clone_path in module.__path__
+    if not codebase_clone_path in module.__path__[0]:
+        raise RuntimeError("Module loaded from incorrect path "+module.__path__[0])
 
 # Path to pass to jobman sqlschedule. IMPORTANT TO CHANGE TO REFLECT YOUR CLONE.
 # Make sure this is accessible from the default $PYTHONPATH (in your .bashrc)
+# (and make sure every subdirectory has its __init__.py file)
 EXPERIMENT_PATH = "ift6266_experiment10.ift6266.deep.stacked_dae.nist_sda.jobman_entrypoint"
 
 # END EXPERIMENT ISOLATION CODE
 # ----------------------------------------------------------------------------
 
+from jobman import DD
+
 '''
 These are parameters used by nist_sda.py. They'll end up as globals in there.
 
--- a/deep/stacked_dae/nist_sda.py	Fri Mar 19 11:12:40 2010 -0400
+++ b/deep/stacked_dae/nist_sda.py	Fri Mar 19 11:31:57 2010 -0400
@@ -61,17 +61,17 @@
 
     print "Creating optimizer with state, ", state
 
-    optimizer = SdaSgdOptimizer(dataset=datasets.nist_all, 
+    optimizer = SdaSgdOptimizer(dataset=datasets.nist_all(), 
                                     hyperparameters=state, \
                                     n_ins=n_ins, n_outs=n_outs,\
                                     examples_per_epoch=examples_per_epoch, \
                                     series=series,
                                     max_minibatches=rtt)
 
-    optimizer.pretrain(datasets.nist_all)
+    optimizer.pretrain(datasets.nist_all())
     channel.save()
 
-    optimizer.finetune(datasets.nist_all)
+    optimizer.finetune(datasets.nist_all())
     channel.save()
 
     return channel.COMPLETE