changeset 856:0cfbaf0c598d

sum change to mean for logistic regression cost over mini-batches
author Xavier Glorot <glorotxa@iro.umontreal.ca>
date Mon, 09 Nov 2009 15:57:00 -0500
parents 553bf0861fb5
children bd7d540db70d
files pylearn/algorithms/logistic_regression.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/algorithms/logistic_regression.py	Mon Nov 09 14:41:00 2009 -0500
+++ b/pylearn/algorithms/logistic_regression.py	Mon Nov 09 15:57:00 2009 -0500
@@ -101,7 +101,7 @@
                     nnet.crossentropy_softmax_max_and_argmax_1hot(
                     self.linear_output, self.target)
 
-        self.unregularized_cost = T.sum(self._xent)
+        self.unregularized_cost = T.mean(self._xent)
         self.l1_cost = self.l1 * T.sum(abs(self.w))
         self.l2_cost = self.l2 * T.sum(self.w**2)
         self.regularized_cost = self.unregularized_cost + self.l1_cost + self.l2_cost