changeset 670:63bcc7024378

removed Member calls from logistic regression
author James Bergstra <bergstrj@iro.umontreal.ca>
date Mon, 30 Mar 2009 16:15:24 -0400
parents d17ebf9ac8c0
children 9e62fd6b6677
files pylearn/__init__.py pylearn/algorithms/logistic_regression.py pylearn/io/tests/test_filetensor.py
diffstat 3 files changed, 14 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/__init__.py	Mon Mar 30 16:00:29 2009 -0400
+++ b/pylearn/__init__.py	Mon Mar 30 16:15:24 2009 -0400
@@ -1,4 +1,4 @@
-import exceptions
+#import exceptions
 
 def __src_version__():
     #todo - this is vulnerable to the bug in theano ticket #160
--- a/pylearn/algorithms/logistic_regression.py	Mon Mar 30 16:00:29 2009 -0400
+++ b/pylearn/algorithms/logistic_regression.py	Mon Mar 30 16:15:24 2009 -0400
@@ -36,15 +36,15 @@
         self.input = input if input is not None else T.matrix()
         self.target = target if target is not None else T.lvector()
 
-        self.w = w if w is not None else module.Member(T.dmatrix())
-        self.b = b if b is not None else module.Member(T.dvector())
+        self.w = w if w is not None else (T.dmatrix())
+        self.b = b if b is not None else (T.dvector())
 
         #the params of the model are the ones we fit to the data
         self.params = [p for p in [self.w, self.b] if p.owner is None]
         
         #the hyper-parameters of the model are not fit to the data
-        self.l2 = l2 if l2 is not None else module.Member(T.dscalar())
-        self.l1 = l1 if l1 is not None else module.Member(T.dscalar())
+        self.l2 = l2 if l2 is not None else (T.dscalar())
+        self.l1 = l1 if l1 is not None else (T.dscalar())
 
         #here we actually build the model
         self.linear_output = T.dot(self.input, self.w) + self.b
@@ -163,12 +163,12 @@
     def __init__(self, input=None, targ=None, w=None, b=None, lr=None, regularize=False):
         super(LogReg2, self).__init__() #boilerplate
 
-        self.input = module.Member(input) if input is not None else T.matrix('input')
-        self.targ = module.Member(targ) if targ is not None else T.lcol()
+        self.input = (input) if input is not None else T.matrix('input')
+        self.targ = (targ) if targ is not None else T.lcol()
 
-        self.w = module.Member(w) if w is not None else module.Member(T.dmatrix())
-        self.b = module.Member(b) if b is not None else module.Member(T.dvector())
-        self.lr = module.Member(lr) if lr is not None else module.Member(T.dscalar())
+        self.w = (w) if w is not None else (T.dmatrix())
+        self.b = (b) if b is not None else (T.dvector())
+        self.lr = (lr) if lr is not None else (T.dscalar())
 
         self.params = [p for p in [self.w, self.b] if p.owner is None]
 
@@ -254,8 +254,8 @@
         self.n_in = n_in
         self.n_out = n_out
 
-        self.w = w if w is not None else module.Member(T.dmatrix())
-        self.b = b if b is not None else module.Member(T.dvector())
+        self.w = w if w is not None else (T.dmatrix())
+        self.b = b if b is not None else (T.dvector())
 
     def _instance_initialize(self, obj):
         obj.w = N.zeros((self.n_in, self.n_out))
--- a/pylearn/io/tests/test_filetensor.py	Mon Mar 30 16:00:29 2009 -0400
+++ b/pylearn/io/tests/test_filetensor.py	Mon Mar 30 16:15:24 2009 -0400
@@ -1,4 +1,6 @@
+
 from pylearn.io import filetensor
+import numpy
 
 import unittest
 import os