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

Function loss_fn

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

Source from the content-addressed store, hash-verified

24
25
26def loss_fn(w):
27 return 0.5 * mx.mean(mx.square(X @ w - y))
28
29
30grad_fn = mx.grad(loss_fn)

Callers 1

Calls 1

meanMethod · 0.80

Tested by

no test coverage detected