mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-05 14:55:15 +02:00
fixed trace_dot to be a litle faster...
This commit is contained in:
parent
ba78e720f2
commit
0503d0e3f5
2 changed files with 2 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue