changeset 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 14ba52c38f07
files pylearn/datasets/utlc.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/datasets/utlc.py	Tue Feb 08 16:19:46 2011 -0500
+++ b/pylearn/datasets/utlc.py	Mon Feb 14 19:27:37 2011 -0500
@@ -67,9 +67,14 @@
 
     if normalize or normalize_on_the_fly:
         if normalize_on_the_fly:
+            # Shared variables of the original type
             train = theano.shared(train, borrow=True, name=name+"_train")
             valid = theano.shared(valid, borrow=True, name=name+"_valid")
             test = theano.shared(test, borrow=True, name=name+"_test")
+            # Symbolic variables cast into floatX
+            train = theano.tensor.cast(train, theano.config.floatX)
+            valid = theano.tensor.cast(valid, theano.config.floatX)
+            test = theano.tensor.cast(test, theano.config.floatX)
         else:
             train = numpy.asarray(train, theano.config.floatX)
             valid = numpy.asarray(valid, theano.config.floatX)