# HG changeset patch # User Joseph Turian # Date 1225208456 14400 # Node ID 02a331ba833b6481dacdf0881c331c462b79cf4a # Parent 32509c479e2d0b66ac574dbf4e902691cab078ac# Parent 6dfdcee64e9bda256329d8c72ec29c690f5a9c31 merge diff -r 32509c479e2d -r 02a331ba833b algorithms/logistic_regression.py --- 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