@@ -340,7 +340,7 @@ def test_DBN(finetune_lr=0.1, pretraining_epochs=100,
340
340
c .append (pretraining_fns [i ](index = batch_index ,
341
341
lr = pretrain_lr ))
342
342
print ('Pre-training layer %i, epoch %d, cost ' % (i , epoch ), end = ' ' )
343
- print (numpy .mean (c ))
343
+ print (numpy .mean (c , dtype = 'float64' ))
344
344
345
345
end_time = timeit .default_timer ()
346
346
# end-snippet-2
@@ -391,7 +391,7 @@ def test_DBN(finetune_lr=0.1, pretraining_epochs=100,
391
391
if (iter + 1 ) % validation_frequency == 0 :
392
392
393
393
validation_losses = validate_model ()
394
- this_validation_loss = numpy .mean (validation_losses )
394
+ this_validation_loss = numpy .mean (validation_losses , dtype = 'float64' )
395
395
print ('epoch %i, minibatch %i/%i, validation error %f %%' % (
396
396
epoch ,
397
397
minibatch_index + 1 ,
@@ -414,7 +414,7 @@ def test_DBN(finetune_lr=0.1, pretraining_epochs=100,
414
414
415
415
# test it on the test set
416
416
test_losses = test_model ()
417
- test_score = numpy .mean (test_losses )
417
+ test_score = numpy .mean (test_losses , dtype = 'float64' )
418
418
print ((' epoch %i, minibatch %i/%i, test error of '
419
419
'best model %f %%' ) %
420
420
(epoch , minibatch_index + 1 , n_train_batches ,
0 commit comments