Mercurial > pylearn
diff linear_regression.py @ 403:273e5c03003e
Making linear_regression more robust
author | Yoshua Bengio <bengioy@iro.umontreal.ca> |
---|---|
date | Wed, 09 Jul 2008 17:55:46 -0400 |
parents | efb797c5efc0 |
children | 5175c564e37a |
line wrap: on
line diff
--- a/linear_regression.py Wed Jul 09 15:27:12 2008 -0400 +++ b/linear_regression.py Wed Jul 09 17:55:46 2008 -0400 @@ -86,7 +86,7 @@ XtX[i+1,i+1]=self.L2_regularizer mbs=min(self.minibatch_size,len(trainset)) for inputs,targets in trainset.minibatches(["input","target"],minibatch_size=mbs): - XtX,XtY=self.equations.update(XtX,XtY,inputs,targets) + XtX,XtY=self.equations.update(XtX,XtY,numpy.array(inputs),numpy.array(targets)) theta=numpy.linalg.solve(XtX,XtY) return LinearPredictor(theta)