diff --git a/GPy/inference/optimization.py b/GPy/inference/optimization.py index 2e29fe6a..0a72aa08 100644 --- a/GPy/inference/optimization.py +++ b/GPy/inference/optimization.py @@ -204,7 +204,7 @@ class opt_scg(Optimizer): def opt(self, f_fp = None, f = None, fp = None): assert not f is None assert not fp is None - opt_result = SCG (f,fp,self.x_init, display=self.messages, + opt_result = SCG (f,fp,self.x_init, display=self.messages) def get_optimizer(f_min): # import rasmussens_minimize as rasm diff --git a/GPy/util/linalg.py b/GPy/util/linalg.py index cf023284..f21502a5 100644 --- a/GPy/util/linalg.py +++ b/GPy/util/linalg.py @@ -18,8 +18,7 @@ def trace_dot(a,b): """ efficiently compute the trace of the matrix product of a and b """ - assert a.shape==b.T.shape - return np.dot(a.flatten(),b.T.flatten()) + return np.sum(a*b) def mdot(*args): """Multiply all the arguments using matrix product rules.