huber
std.loss.huber · Level L1Huber loss: quadratic for small errors, linear beyond δ. Calls abs.
mean( ½d² if |d| ≤ δ else δ(|d| − ½δ) ), d = y − t
Signature
huber(y: f64[n], t: f64[n], delta: f64[]) → f64[]
Structure
The function as NOVA stores it: one box per input, operation and output, and arrows that carry values. A double border marks another library function this one runs — called once, or by Scan once per element; select it to open that function.
- input
- operation
- constant
- call
- output
Verification
- Signature proven by NOVA’s shape solver, for every size.
- Equal to the reference
np.mean(np.where(|d| <= delta, 0.5*d**2, delta*(|d| - 0.5*delta)))in exact rational arithmetic, on all 40 test cases. - All 40 float64 results inside the running error bound; the closest uses 39% of it.
- Interpreter and NumPy backend return bit-identical results.
Accuracy in detail
- correctly rounded (the float64 nearest the exact value)
- 73%
- bit-equal to the NumPy formula in float64
- 100%
- largest error, in units in the last place
- 1.19
Identity
sha256:09e7f932f09315129a5626bf600bdb7e3ff10d3f7c28bba956b661771e43c974The semantic hash of the graph. It changes when the program changes, and never when only its documentation does.
Control handle
- Symbol
- Ω:std.loss.huber · Ω:huber
- Pins
sha256:6a0a30e724a3cbe2a88e1367b38976b3c7ac49760fe7a99e85d63f29a307302bthis graph and the 1 it reaches through calls- Evidence
sha256:cf906505d72eb7ce689c4cf288fcb117d7d96890fa691850a8beb108061ea055the hash of its verification record- Needs
- no capability: a pure function
Through NOVA’s control layer, the symbol launches this function only while the program still matches what it pins: a change to this graph, or to any graph it reaches, needs a migration first.