Radius Verification API¶
CPU verification measures live gradients, radius spread, sector radii, manifold residual and chunked distance precision for the hyperbolic arm, and term and scale gradients for every arm. The report does not open or read an evaluation panel.
Radius and gradient checks for a selected arm (spec 4.2, Verification Radius, No inert terms).
The radius checks are the hyperbolic arm's, the one arm with the radial term and the live-radius head (Req 12, 13). Every arm's terms and scales are checked for gradient.
RadiusReport
dataclass
¶
The selected table's radius checks and the batch's signed anchor-radius gradients.
level_sd is the population SD at each observed level. pairs counts every ordered
pair, self pairs included. Exact coincident tangent rows have mathematical distance zero:
their float32 distance must be exactly zero, and their float64 read cancellation residual
is recorded separately, since relative error at zero is undefined. Every other pair must
have a positive read distance and relative error at most 1e-3; there is no denominator floor.
A table-only report leaves the gradient unmeasured and cannot pass all the checks.
passed
property
¶
Whether every required check was measured and passed.
radius_report(table, *, anchor_radius_gradient=None)
¶
Check Verification Radius's quantities on a table in Req 2's tangent-coordinate form.
The manifold residual is measured at the largest observed radius, on the float64 points
the arm's reads use. All distances are checked in bounded row chunks. anchor_radius_gradient
is the real batch's signed dL/dr_a, one per anchor; missing, empty, zero or nonfinite gradients
fail the corresponding check. Nonfinite supplied entries are represented by None in the report.
Raises:
| Type | Description |
|---|---|
ValueError
|
If the coordinate table is invalid, empty, has incorrect level metadata, the gradient is not one-dimensional, or the resulting points or distances are not finite. |
term_gradients(model, batch)
¶
Measure No inert terms and, in the hyperbolic arm, signed dL/dr_a on one two-stream batch (spec 6, P26).
Each term's norm is taken over the trainable encoder parameters, with its contribution's
weight. The two scale gradients come from the total, so a zero-weight code-code term also
leaves its scale inert. The radial term and anchor_radius/<row>, each signed total-loss
radius gradient, are the hyperbolic arm's alone (Req 12): a flat arm reports neither.
Existing parameter gradients and training flags are preserved. MoE utilization logging is
suppressed for this computation only, so no Trainer, log warning or histogram is produced.