From d6a56a6f0bf234f4c8c9f9f1b595ff5c9305bed0 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Mon, 9 Feb 2015 09:35:32 +1100 Subject: [PATCH] changed operator.mul to np.multiply for consistency --- GPy/kern/_src/prod.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/GPy/kern/_src/prod.py b/GPy/kern/_src/prod.py index 4f9f5ea6..241c2448 100644 --- a/GPy/kern/_src/prod.py +++ b/GPy/kern/_src/prod.py @@ -5,7 +5,6 @@ import numpy as np from kern import CombinationKernel from ...util.caching import Cache_this import itertools -import operator def numpy_invalid_op_as_exception(func): @@ -64,7 +63,7 @@ class Prod(CombinationKernel): except FloatingPointError: #print "WARNING: gradient calculation falling back to slow version due to zero-valued kernel" for combination in itertools.combinations(self.parts, len(self.parts) - 1): - prod = reduce(operator.mul, [p.K(X, X2) for p in combination]) + prod = reduce(np.multiply, [p.K(X, X2) for p in combination]) to_update = list(set(self.parts) - set(combination))[0] to_update.update_gradients_full(dL_dK * prod, X, X2)