diff deep/stacked_dae/v_sylvain/sgd_optimization.py @ 283:28b628f331b2

correction d'un bug sur l'indice des mini-batches
author SylvainPL <sylvain.pannetier.lebeuf@umontreal.ca>
date Wed, 24 Mar 2010 14:58:58 -0400
parents a8b92a4a708d
children 1cc535f3e254
line wrap: on
line diff
--- a/deep/stacked_dae/v_sylvain/sgd_optimization.py	Wed Mar 24 14:45:02 2010 -0400
+++ b/deep/stacked_dae/v_sylvain/sgd_optimization.py	Wed Mar 24 14:58:58 2010 -0400
@@ -195,10 +195,11 @@
         epoch = 0
 
         total_mb_index = 0
+        minibatch_index = -1
 
         while (epoch < num_finetune) and (not done_looping):
             epoch = epoch + 1
-            minibatch_index = -1
+
             for x,y in dataset.train(minibatch_size):
                 minibatch_index += 1
                 if special == 0:
@@ -210,7 +211,7 @@
                 self.series["training_error"].append((epoch, minibatch_index), cost_ij)
 
                 if (total_mb_index+1) % validation_frequency == 0: 
-                    
+                    #minibatch_index += 1
                     #The validation set is always NIST
                     if ind_test == 0:
                         iter=dataset_test.valid(minibatch_size)