diff algorithms/logistic_regression.py @ 472:69c800af1370

changed weight initialization for logistic regression
author James Bergstra <bergstrj@iro.umontreal.ca>
date Thu, 23 Oct 2008 13:26:42 -0400
parents bd937e845bbb
children 31acd42b2b0b
line wrap: on
line diff
--- a/algorithms/logistic_regression.py	Thu Oct 23 13:26:11 2008 -0400
+++ b/algorithms/logistic_regression.py	Thu Oct 23 13:26:42 2008 -0400
@@ -10,11 +10,11 @@
 
 class Module_Nclass(module.FancyModule):
     class __instance_type__(module.FancyModuleInstance):
-        def initialize(self, n_in, n_out, rng=N.random):
+        def initialize(self, n_in, n_out):
             #self.component is the LogisticRegressionTemplate instance that built this guy.
 
-            self.w = rng.randn(n_in, n_out)
-            self.b = rng.randn(n_out)
+            self.w = N.zeros((n_in, n_out))
+            self.b = N.zeros(n_out)
             self.lr = 0.01
             self.__hide__ = ['params']