changeset 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 45b3eb429c15
children 31acd42b2b0b
files algorithms/logistic_regression.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
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']