changeset 219:cde71d24f235

Merge
author fsavard
date Wed, 10 Mar 2010 20:14:20 -0500
parents 4c137f16b013 (current diff) de3aef84714a (diff)
children e172ef73cdc5
files
diffstat 2 files changed, 16 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/datasets/ftfile.py	Wed Mar 10 20:13:45 2010 -0500
+++ b/datasets/ftfile.py	Wed Mar 10 20:14:20 2010 -0500
@@ -193,12 +193,19 @@
         if valid_data is None:
             total_valid_size = sum(FTFile(td).size for td in test_data)
             valid_size = total_valid_size/len(train_data)
-            self._train = FTData(train_data, train_lbl, size=-valid_size)
-            self._valid = FTData(train_data, train_lbl, skip=-valid_size)
+            self._train = FTData(train_data, train_lbl, size=-valid_size,
+                    inscale=inscale, outscale=outscale, indtype=indtype,
+                    outdtype=outdtype)
+            self._valid = FTData(train_data, train_lbl, skip=-valid_size,
+                    inscale=inscale, outscale=outscale, indtype=indtype, 
+                    outdtype=outdtype)
         else:
-            self._train = FTData(train_data, train_lbl)
-            self._valid = FTData(valid_data, valid_lbl)
-        self._test = FTData(test_data, test_lbl)
+            self._train = FTData(train_data, train_lbl,inscale=inscale,
+                    outscale=outscale, indtype=indtype, outdtype=outdtype)
+            self._valid = FTData(valid_data, valid_lbl,inscale=inscale,
+                    outscale=outscale, indtype=indtype, outdtype=outdtype)
+        self._test = FTData(test_data, test_lbl,inscale=inscale,
+                outscale=outscale, indtype=indtype, outdtype=outdtype)
 
     def _return_it(self, batchsize, bufsize, ftdata):
         return izip(DataIterator(ftdata.open_inputs(), batchsize, bufsize),
--- a/deep/convolutional_dae/stacked_convolutional_dae.py	Wed Mar 10 20:13:45 2010 -0500
+++ b/deep/convolutional_dae/stacked_convolutional_dae.py	Wed Mar 10 20:14:20 2010 -0500
@@ -56,7 +56,7 @@
         self.b = theano.shared(value = initial_b, name = "b")
     
  
-    initial_b_prime= numpy.zeros((filter_shape[1],))
+    initial_b_prime= numpy.zeros((filter_shape[1],),dtype=theano.config.floatX)
         
     self.W_prime=T.dtensor4('W_prime')
 
@@ -64,7 +64,7 @@
  
     self.x = input
 
-    self.tilde_x = theano_rng.binomial( self.x.shape, 1, 1 - corruption_level) * self.x
+    self.tilde_x = theano_rng.binomial( self.x.shape, 1, 1 - corruption_level,dtype=theano.config.floatX) * self.x
 
     conv1_out = conv.conv2d(self.tilde_x, self.W, filter_shape=filter_shape,
                             image_shape=image_shape, border_mode='valid')
@@ -135,7 +135,7 @@
         self.conv_n_layers = len(conv_hidden_layers_sizes)
         self.mlp_n_layers = len(mlp_hidden_layers_sizes)
         
-        self.x = T.dmatrix('x') # the data is presented as rasterized images
+        self.x = T.matrix('x') # the data is presented as rasterized images
         self.y = T.ivector('y') # the labels are presented as 1D vector of
         
         for i in xrange( self.conv_n_layers ):
@@ -156,7 +156,7 @@
             
             self.layers += [layer]
             self.params += layer.params
-            
+
             da_layer = dA_conv(corruption_level = corruption_levels[0],
                                input = layer_input,
                                shared_W = layer.W, shared_b = layer.b,