GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove .value in SdA · mpage/DeepLearningTutorials@ad93036

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • code
    • SdA.py
  • doc
    • SdA.txt
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎code/SdA.py‎

Copy file name to clipboardExpand all lines: code/SdA.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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)
Collapse file

‎doc/SdA.txt‎

Copy file name to clipboardExpand all lines: doc/SdA.txt
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ during training we associate a Theano variable to them.
238238
corruption_level = T.scalar('corruption') # amount of corruption to use
239239
learning_rate = T.scalar('lr') # learning rate to use
240240
# number of batches
241-
n_batches = train_set_x.value.shape[0] / batch_size
241+
n_batches = train_set_x.get_value(borrow=True).shape[0] / batch_size
242242
# begining of a batch, given `index`
243243
batch_begin = index * batch_size
244244
# ending of a batch given `index`
@@ -298,8 +298,8 @@ during finetuning ( a ``train_model``, a ``validate_model`` and a
298298
(test_set_x , test_set_y ) = datasets[2]
299299

300300
# compute number of minibatches for training, validation and testing
301-
n_valid_batches = valid_set_x.value.shape[0] / batch_size
302-
n_test_batches = test_set_x.value.shape[0] / batch_size
301+
n_valid_batches = valid_set_x.get_value(borrow=True).shape[0] / batch_size
302+
n_test_batches = test_set_x.get_value(borrow=True).shape[0] / batch_size
303303

304304
index = T.lscalar('index') # index to a [mini]batch
305305

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.