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

Function grad

test/test_optim.py:154–155  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

152 return nx.sum((x - 5.0) ** 2)
153
154 def grad(x):
155 return 2 * (x - 5.0)
156
157 xk = nx.from_numpy(np.array([[[-5.0, -5.0]]]))
158 pk = nx.from_numpy(np.array([[[100.0, 100.0]]]))

Calls

no outgoing calls

Tested by

no test coverage detected