@@ -186,7 +186,7 @@ def pretraining_functions(self, train_set_x, batch_size):
186186 corruption_level = T .scalar ('corruption' ) # amount of corruption to use
187187 learning_rate = T .scalar ('lr' ) # learning rate to use
188188 # number of batches
189- n_batches = train_set_x .value .shape [0 ] / batch_size
189+ n_batches = train_set_x .get_value ( borrow = True ) .shape [0 ] / batch_size
190190 # begining of a batch, given `index`
191191 batch_begin = index * batch_size
192192 # ending of a batch given `index`
@@ -234,8 +234,8 @@ def build_finetune_functions(self, datasets, batch_size, learning_rate):
234234 (test_set_x , test_set_y ) = datasets [2 ]
235235
236236 # compute number of minibatches for training, validation and testing
237- n_valid_batches = valid_set_x .value .shape [0 ] / batch_size
238- n_test_batches = test_set_x .value .shape [0 ] / batch_size
237+ n_valid_batches = valid_set_x .get_value ( borrow = True ) .shape [0 ] / batch_size
238+ n_test_batches = test_set_x .get_value ( borrow = True ) .shape [0 ] / batch_size
239239
240240 index = T .lscalar ('index' ) # index to a [mini]batch
241241
@@ -313,7 +313,7 @@ def test_SdA( finetune_lr = 0.1, pretraining_epochs = 15, \
313313
314314
315315 # compute number of minibatches for training, validation and testing
316- n_train_batches = train_set_x .value .shape [0 ] / batch_size
316+ n_train_batches = train_set_x .get_value ( borrow = True ) .shape [0 ] / batch_size
317317
318318 # numpy random generator
319319 numpy_rng = numpy .random .RandomState (89677 )
0 commit comments