mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-04 01:02:39 +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
|
|
@ -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