changeset 403:273e5c03003e

Making linear_regression more robust
author Yoshua Bengio <bengioy@iro.umontreal.ca>
date Wed, 09 Jul 2008 17:55:46 -0400
parents ffdd2c199f2a
children 8cc11ac97087
files linear_regression.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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)