Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
26
def
loss_fn(w):
27
return
0.5 * mx.mean(mx.square(X @ w - y))
28
29
30
grad_fn = mx.grad(loss_fn)
Callers
1
linear_regression.py
File · 0.70
Calls
1
mean
Method · 0.80
Tested by
no test coverage detected