comparison pylearn/datasets/utlc.py @ 1432:8661f8ad407a

Add a cast in the chain of transformation of initial data set
author Pascal Lamblin <lamblinp@iro.umontreal.ca>
date Mon, 14 Feb 2011 19:27:37 -0500
parents dce602150b5f
children 08beb6f28809
comparison
equal deleted inserted replaced
1431:dce602150b5f 1432:8661f8ad407a
65 perm = rng.permutation(test.shape[0]) 65 perm = rng.permutation(test.shape[0])
66 test = test[perm] 66 test = test[perm]
67 67
68 if normalize or normalize_on_the_fly: 68 if normalize or normalize_on_the_fly:
69 if normalize_on_the_fly: 69 if normalize_on_the_fly:
70 # Shared variables of the original type
70 train = theano.shared(train, borrow=True, name=name+"_train") 71 train = theano.shared(train, borrow=True, name=name+"_train")
71 valid = theano.shared(valid, borrow=True, name=name+"_valid") 72 valid = theano.shared(valid, borrow=True, name=name+"_valid")
72 test = theano.shared(test, borrow=True, name=name+"_test") 73 test = theano.shared(test, borrow=True, name=name+"_test")
74 # Symbolic variables cast into floatX
75 train = theano.tensor.cast(train, theano.config.floatX)
76 valid = theano.tensor.cast(valid, theano.config.floatX)
77 test = theano.tensor.cast(test, theano.config.floatX)
73 else: 78 else:
74 train = numpy.asarray(train, theano.config.floatX) 79 train = numpy.asarray(train, theano.config.floatX)
75 valid = numpy.asarray(valid, theano.config.floatX) 80 valid = numpy.asarray(valid, theano.config.floatX)
76 test = numpy.asarray(test, theano.config.floatX) 81 test = numpy.asarray(test, theano.config.floatX)
77 82