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