changeset 294:8babd43235dd

Save best valid score and test score in the db.
author Arnaud Bergeron <abergeron@gmail.com>
date Sat, 27 Mar 2010 13:39:48 -0400
parents d89820070ea0
children a6b6b1140de9
files deep/convolutional_dae/run_exp.py deep/convolutional_dae/sgd_opt.py
diffstat 2 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/deep/convolutional_dae/run_exp.py	Fri Mar 26 19:18:03 2010 -0400
+++ b/deep/convolutional_dae/run_exp.py	Sat Mar 27 13:39:48 2010 -0400
@@ -60,9 +60,16 @@
 
     print "training ..."
     sys.stdout.flush()
-    sgd_opt(train, valid, test, training_epochs=100000, patience=10000,
-            patience_increase=2., improvement_threshold=0.995,
-            validation_frequency=1000, series=series, net=net)
+    best_valid, test_score = sgd_opt(train, valid, test,
+                                     training_epochs=100000, patience=10000,
+                                     patience_increase=2.,
+                                     improvement_threshold=0.995,
+                                     validation_frequency=1000,
+                                     series=series, net=net)
+    state.best_valid = best_valid
+    state.test_score = test_score
+    channel.save()
+    return channel.COMPLETE
 
 if __name__ == '__main__':
     st = dumb()
--- a/deep/convolutional_dae/sgd_opt.py	Fri Mar 26 19:18:03 2010 -0400
+++ b/deep/convolutional_dae/sgd_opt.py	Sat Mar 27 13:39:48 2010 -0400
@@ -1,5 +1,5 @@
 import time
-import sys
+import sys, os
 
 from ift6266.utils.seriestables import *
 
@@ -63,3 +63,4 @@
                  (best_validation_loss * 100., test_score*100.))
     print ('The code ran for %f minutes' % ((end_time-start_time)/60.))
 
+    return best_validation_loss, test_score