MCPcopy Create free account
hub / github.com/PythonOT/POT / Vpi

Function Vpi

ot/dr.py:373–381  ·  view source on GitHub ↗
(X, Y, a, b, pi)

Source from the content-addressed store, hash-verified

371 U = U0
372
373 def Vpi(X, Y, a, b, pi):
374 # Return the second order matrix of the displacements: sum_ij { (pi)_ij (X_i-Y_j)(X_i-Y_j)^T }.
375 A = X.T.dot(pi).dot(Y)
376 return (
377 X.T.dot(np.diag(a)).dot(X)
378 + Y.T.dot(np.diag(np.sum(pi, 0))).dot(Y)
379 - A
380 - A.T
381 )
382
383 err = 1
384 iter = 0

Callers 1

Calls 3

dotMethod · 0.45
diagMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected