# HG changeset patch # User Frederic Bastien # Date 1303918476 14400 # Node ID c41fdf8c35b80218f170ffb00b20a2704321ca3a # Parent cac29ca79a741e0b61549e18ec8787fdf145d4fc fix about floatX=float32 to remove error in the build bot. diff -r cac29ca79a74 -r c41fdf8c35b8 pylearn/algorithms/aa.py --- a/pylearn/algorithms/aa.py Wed Apr 27 10:43:04 2011 -0400 +++ b/pylearn/algorithms/aa.py Wed Apr 27 11:34:36 2011 -0400 @@ -2,6 +2,8 @@ import theano from theano import tensor as T from theano.tensor import nnet as NN +floatX = theano.config.floatX + import numpy as N class AutoEncoder(theano.Module): @@ -73,11 +75,15 @@ if input_size is not None: sz = (input_size, hidden_size) range = 1/N.sqrt(input_size) - obj.w1 = R.uniform(size = sz, low = -range, high = range) + if floatX=='float32': + range = N.float32(range) + obj.w1 = N.asarray(R.uniform(size = sz, low = -range, high = range), + dtype=floatX) if not self.tie_weights: - obj.w2 = R.uniform(size = list(reversed(sz)), low = -range, high = range) - obj.b1 = N.zeros(hidden_size) - obj.b2 = N.zeros(input_size) + obj.w2 = N.asarray(R.uniform(size = list(reversed(sz)), low = -range, high = range), + dtype=floatX) + obj.b1 = N.zeros(hidden_size, dtype=floatX) + obj.b2 = N.zeros(input_size, dtype=floatX) def build_regularization(self): return T.zero() # no regularization!