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

Method max_Omega

ot/smooth.py:196–202  ·  view source on GitHub ↗
(self, X, b)

Source from the content-addressed store, hash-verified

194 return val, G
195
196 def max_Omega(self, X, b):
197 max_X = np.max(X, axis=0) / self.gamma
198 exp_X = np.exp(X / self.gamma - max_X)
199 val = self.gamma * (np.log(np.sum(exp_X, axis=0)) + max_X)
200 val -= self.gamma * np.log(b)
201 G = exp_X / np.sum(exp_X, axis=0)
202 return val, G
203
204 def Omega(self, T):
205 return self.gamma * np.sum(T * np.log(T))

Callers

nothing calls this directly

Calls 4

maxMethod · 0.45
expMethod · 0.45
logMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected