ResidualAffine #
Helpers for assembling PDE residual bounds using affine CROWN relaxations where available.
This module provides:
- Eval of an affine upper/lower bound on the network output u(x) using runAffine and AffineVec.eval_on_box, given the current input box.
- McCormick-style linear upper/lower envelopes for scalar products over independent intervals (for Burgers-type residuals).
- A compact branch-and-bound splitter on the 1D input box to tighten bounds by subdividing the domain and taking the envelope across sub-boxes.
Notes:
- We intentionally keep this file numeric (Float) and specialized to this workflow.
References:
- CROWN / DeepPoly-style affine bounds:
https://arxiv.org/abs/1811.00866 - alpha,beta-CROWN (context):
https://arxiv.org/abs/2103.06624
Cast a dimension-indexed vector box across definitional equality of Nats.
Instances For
Forward CROWN/DeepPoly bounds for the scalar output u (or sum of outputs).
Instances For
Objective-dependent (backward/dual) CROWN bounds for the scalar output u (or sum of outputs).
Instances For
Backwards-compatible name used by the PINN CLI: treat "affine" u-bounds as objective-dependent CROWN.
Instances For
Scalar product upper envelope over rectangles using McCormick. Given u∈[lx,ux], v∈[ly,uy], returns an affine upper bound of the form uv ≤ axu + ayv + c, as coefficients (ax, ay, c). We pick the tighter of the two classical McCormick upper planes.
Instances For
Basic 1D branch-and-bound over the input box [x-ε,x+ε]. Recursively splits the
box up to maxDepth or until width ≤ minWidth. On each sub-box it calls
the provided bounding function boundOn which must return (lo, hi).
Returns the tightest global (min lo, max hi) across sub-boxes.