@@ -443,7 +443,7 @@ instantiate the network as follows.
443443
444444.. code-block:: python
445445
446- learning_rate = 0.001
446+ learning_rate = 0.1
447447 rng = numpy.random.RandomState(23455)
448448
449449 train_batches, valid_batches, test_batches = load_dataset(dataset)
@@ -466,31 +466,32 @@ instantiate the network as follows.
466466 # Construct the first convolutional pooling layer:
467467 # filtering reduces the image size to (28-5+1,28-5+1)=(24,24)
468468 # maxpooling reduces this further to (24/2,24/2) = (12,12)
469- # 4D output tensor is thus of shape (20,6 ,12,12)
469+ # 4D output tensor is thus of shape (20,20 ,12,12)
470470 layer0 = LeNetConvPoolLayer(rng, input=layer0_input,
471- image_shape=(batch_size,1,28,28),
472- filter_shape=(6 ,1,5,5), poolsize=(2,2))
471+ image_shape=(batch_size,1,28,28),
472+ filter_shape=(20 ,1,5,5), poolsize=(2,2))
473473
474474 # Construct the second convolutional pooling layer
475475 # filtering reduces the image size to (12-5+1,12-5+1)=(8,8)
476476 # maxpooling reduces this further to (8/2,8/2) = (4,4)
477- # 4D output tensor is thus of shape (20,32 ,4,4)
477+ # 4D output tensor is thus of shape (20,50 ,4,4)
478478 layer1 = LeNetConvPoolLayer(rng, input=layer0.output,
479- image_shape=(batch_size,6 ,12,12),
480- filter_shape=(32,6 ,5,5), poolsize=(2,2))
479+ image_shape=(batch_size,20 ,12,12),
480+ filter_shape=(50,20 ,5,5), poolsize=(2,2))
481481
482482 # the SigmoidalLayer being fully-connected, it operates on 2D matrices of
483483 # shape (batch_size,num_pixels) (i.e matrix of rasterized images).
484484 # This will generate a matrix of shape (20,32*4*4) = (20,512)
485485 layer2_input = layer1.output.flatten(2)
486486
487487 # construct a fully-connected sigmoidal layer
488- layer2 = SigmoidalLayer(rng, input=layer2_input,
489- n_in=32 *4*4, n_out=500)
488+ layer2 = SigmoidalLayer(rng, input=layer2_input,
489+ n_in=50 *4*4, n_out=500)
490490
491491 # classify the values of the fully-connected sigmoidal layer
492492 layer3 = LogisticRegression(input=layer2.output, n_in=500, n_out=10)
493493
494+
494495 # the cost we minimize during training is the NLL of the model
495496 cost = layer3.negative_log_likelihood(y)
496497
@@ -527,20 +528,17 @@ The following output was obtained with a learning rate of 0.1:
527528
528529.. code-block:: bash
529530
530- Best validation score of 1.080000 % obtained at iteration 27499,with test
531- performance 1.090000 %
532- The code ran for 62.096667 minutes
533-
531+ Optimization complete.
532+ Best validation score of 0.900000 % obtained at iteration 12499,with test
533+ performance 0.990000 %
534+ The code ran for 85.694333 minutes
534535
535536Tips and Tricks
536537+++++++++++++++
537538
538539Choosing Hyperparameters
539540------------------------
540541
541- Running on the GPU
542- ------------------
543-
544542
545543References
546544++++++++++
0 commit comments