MCPcopy Create free account
hub / github.com/ml-explore/mlx / loss_fn

Function loss_fn

examples/python/logistic_regression.py:26–28  ·  view source on GitHub ↗
(w)

Source from the content-addressed store, hash-verified

24
25
26def loss_fn(w):
27 logits = X @ w
28 return mx.mean(mx.logaddexp(0.0, logits) - y * logits)
29
30
31grad_fn = mx.grad(loss_fn)

Callers 1

Calls 1

meanMethod · 0.80

Tested by

no test coverage detected