@@ -186,7 +186,7 @@ def pretraining_functions(self, train_set_x, batch_size): |
186 | 186 | corruption_level = T.scalar('corruption') # amount of corruption to use |
187 | 187 | learning_rate = T.scalar('lr') # learning rate to use |
188 | 188 | # 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 |
190 | 190 | # begining of a batch, given `index` |
191 | 191 | batch_begin = index * batch_size |
192 | 192 | # ending of a batch given `index` |
@@ -234,8 +234,8 @@ def build_finetune_functions(self, datasets, batch_size, learning_rate): |
234 | 234 | (test_set_x , test_set_y ) = datasets[2] |
235 | 235 |
|
236 | 236 | # 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 |
239 | 239 |
|
240 | 240 | index = T.lscalar('index') # index to a [mini]batch |
241 | 241 |
|
@@ -313,7 +313,7 @@ def test_SdA( finetune_lr = 0.1, pretraining_epochs = 15, \ |
313 | 313 |
|
314 | 314 |
|
315 | 315 | # 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 |
317 | 317 |
|
318 | 318 | # numpy random generator |
319 | 319 | numpy_rng = numpy.random.RandomState(89677) |
|