changeset 492:6dfdcee64e9b

merge
author Olivier Breuleux <breuleuo@iro.umontreal.ca>
date Tue, 28 Oct 2008 11:39:47 -0400
parents 180d125dc7e2 (diff) 4f3c66146f17 (current diff)
children 02a331ba833b
files sandbox/weights.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/algorithms/logistic_regression.py	Tue Oct 28 10:54:26 2008 -0400
+++ b/algorithms/logistic_regression.py	Tue Oct 28 11:39:47 2008 -0400
@@ -18,7 +18,7 @@
             self.lr = 0.01
             self.__hide__ = ['params']
 
-    def __init__(self, x=None, targ=None, w=None, b=None, lr=None):
+    def __init__(self, x=None, targ=None, w=None, b=None, lr=None, regularize=False):
         super(Module_Nclass, self).__init__() #boilerplate
 
         self.x = x if x is not None else T.matrix()
@@ -36,6 +36,7 @@
 
         self.y = y
         self.sum_xent = sum_xent
+        self.cost = sum_xent
 
         #define the apply method
         self.pred = T.argmax(T.dot(self.x, self.w) + self.b, axis=1)
@@ -57,7 +58,7 @@
             self.lr = 0.01
             self.__hide__ = ['params']
 
-    def __init__(self, x=None, targ=None, w=None, b=None, lr=None):
+    def __init__(self, x=None, targ=None, w=None, b=None, lr=None, regularize=False):
         super(Module, self).__init__() #boilerplate
 
         self.x = x if x is not None else T.matrix()
@@ -76,6 +77,7 @@
         self.y = y
         self.xent = xent
         self.sum_xent = sum_xent
+        self.cost = sum_xent
 
         #define the apply method
         self.pred = (T.dot(self.x, self.w) + self.b) > 0.0