From 732e972cd039cb7e5d069c74b2332ff72b3d8807 Mon Sep 17 00:00:00 2001 From: mamrehn Date: Mon, 27 Mar 2017 15:19:33 +0200 Subject: [PATCH] Prevent creation of tensor with type float64. Utilizing a `.theanorc` including `floatX=float32` and `warn_float64=warn`, there was a warning when a theano tensor was created here with type float64, which does not yield performant computations on current GPUs. Change it to the desired type defined in the `.theanorc` config. --- nolearn/lasagne/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nolearn/lasagne/base.py b/nolearn/lasagne/base.py index e449a9b..77ec7bc 100644 --- a/nolearn/lasagne/base.py +++ b/nolearn/lasagne/base.py @@ -626,7 +626,7 @@ def _create_iter_funcs(self, layers, objective, update, output_type): predict_proba = get_output(output_layer, None, deterministic=True) if not self.regression: predict = predict_proba[0].argmax(axis=1) - accuracy = T.mean(T.eq(predict, y_batch)) + accuracy = T.mean(T.eq(predict, y_batch), dtype=theano.config.floatX) else: accuracy = loss_eval