@@ -340,7 +340,7 @@ def test_DBN(finetune_lr=0.1, pretraining_epochs=100,
340340 c .append (pretraining_fns [i ](index = batch_index ,
341341 lr = pretrain_lr ))
342342 print ('Pre-training layer %i, epoch %d, cost ' % (i , epoch ), end = ' ' )
343- print (numpy .mean (c ))
343+ print (numpy .mean (c , dtype = 'float64' ))
344344
345345 end_time = timeit .default_timer ()
346346 # end-snippet-2
@@ -391,7 +391,7 @@ def test_DBN(finetune_lr=0.1, pretraining_epochs=100,
391391 if (iter + 1 ) % validation_frequency == 0 :
392392
393393 validation_losses = validate_model ()
394- this_validation_loss = numpy .mean (validation_losses )
394+ this_validation_loss = numpy .mean (validation_losses , dtype = 'float64' )
395395 print ('epoch %i, minibatch %i/%i, validation error %f %%' % (
396396 epoch ,
397397 minibatch_index + 1 ,
@@ -414,7 +414,7 @@ def test_DBN(finetune_lr=0.1, pretraining_epochs=100,
414414
415415 # test it on the test set
416416 test_losses = test_model ()
417- test_score = numpy .mean (test_losses )
417+ test_score = numpy .mean (test_losses , dtype = 'float64' )
418418 print ((' epoch %i, minibatch %i/%i, test error of '
419419 'best model %f %%' ) %
420420 (epoch , minibatch_index + 1 , n_train_batches ,
0 commit comments