changeset 494:02a331ba833b

merge
author Joseph Turian <turian@gmail.com>
date Tue, 28 Oct 2008 11:40:56 -0400
parents 32509c479e2d (current diff) 6dfdcee64e9b (diff)
children 7560817a07e8
files
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/algorithms/logistic_regression.py	Tue Oct 28 11:40:31 2008 -0400
+++ b/algorithms/logistic_regression.py	Tue Oct 28 11:40:56 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