# HG changeset patch # User Olivier Breuleux # Date 1225208387 14400 # Node ID 6dfdcee64e9bda256329d8c72ec29c690f5a9c31 # Parent 180d125dc7e2c01280cc832df82c3972aab534b9# Parent 4f3c66146f170d5481cc4ce22a8006c92ea72252 merge diff -r 4f3c66146f17 -r 6dfdcee64e9b algorithms/logistic_regression.py --- 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