NF Backward Approximation Backend #
Core approximation lemmas for the rounded NF backend: constants, sparse context writes, and the context-addition bound used when reverse-mode contributions have to be accumulated.
Cast a tensor across a shape equality induced by equal Idx positions.
Given a : Idx Γ s₁, b : Idx Γ s₂, and h : a.i = b.i, this produces a function
Tensor α s₂ → Tensor α s₁ that casts along the implied equality s₁ = s₂.
Instances For
Context-wise addition bound (NF runtime vs spec).
This produces an EList of linf_norm bounds for adding two contexts elementwise, and is used when
reverse-mode accumulation must combine contributions from multiple consumers.
Instances For
Soundness of context-wise addition under approxCtx.
If xS ~ xR ± epsx and yS ~ yR ± epsy, then (xS + yS) ~ (xR + yR) with error bounded by
ctxAddBound epsx epsy xR yR.