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

Function solve_G

ot/mapping.py:570–591  ·  view source on GitHub ↗

Update G with CG algorithm

(L, G0)

Source from the content-addressed store, hash-verified

568 return nx.solve(xstxs + eta * Id, nx.dot(xs1.T, xst) + eta * I0)
569
570 def solve_G(L, G0):
571 """Update G with CG algorithm"""
572 xsi = nx.dot(xs1, L)
573
574 def f(G):
575 return nx.sum((xsi - ns * nx.dot(G, xt)) ** 2)
576
577 def df(G):
578 return -2 * ns * nx.dot(xsi - ns * nx.dot(G, xt), xt.T)
579
580 G = cg(
581 a,
582 b,
583 M,
584 1.0 / mu,
585 f,
586 df,
587 G0=G0,
588 numItermax=numInnerItermax,
589 stopThr=stopInnerThr,
590 )
591 return G
592
593 L = solve_L(G)
594

Callers 2

joint_OT_mapping_linearFunction · 0.85
joint_OT_mapping_kernelFunction · 0.85

Calls 2

cgFunction · 0.85
dotMethod · 0.45

Tested by

no test coverage detected