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

Function loss

ot/mapping.py:557–563  ·  view source on GitHub ↗

Compute full loss

(L, G)

Source from the content-addressed store, hash-verified

555 vloss = []
556
557 def loss(L, G):
558 """Compute full loss"""
559 return (
560 nx.sum((nx.dot(xs1, L) - ns * nx.dot(G, xt)) ** 2)
561 + mu * nx.sum(G * M)
562 + eta * nx.sum(sel(L - I0) ** 2)
563 )
564
565 def solve_L(G):
566 """solve L problem with fixed G (least square)"""

Callers 3

joint_OT_mapping_linearFunction · 0.70
joint_OT_mapping_kernelFunction · 0.70

Calls 5

selFunction · 0.85
dotsFunction · 0.85
sumMethod · 0.45
dotMethod · 0.45
traceMethod · 0.45

Tested by

no test coverage detected