TorchLean API

NN.Runtime.RL.Numerics.Float32.Intervals

Float32 Interval Diagnostics for RL #

This module uses FloatLib's outward-rounded binary32 intervals for return, GAE, TD-residual, and PPO scalar formulas used by the checked binary32 runtime. These intervals are executable diagnostics: they do not replace the exact RL specs, but they flag overflow, invalid endpoints, and unstable recurrences in examples and regression tests.

References: IEEE 1788-2015 for interval arithmetic semantics; Sutton and Barto for return and TD recurrences; Schulman et al. for GAE and PPO.

Interval Enclosures (configured binary32 endpoint intervals) #

Outward-rounded interval enclosure for the PPO clipped surrogate objective from a precomputed ratio.

The clipping thresholds 1 - clipEps and 1 + clipEps are themselves outward-rounded intervals, so the clipped ratio is enclosed even when the exact real threshold is not a binary32 value. Clipping is monotone in the ratio and in both thresholds, so its range over the threshold intervals is exact at the endpoints. The result is the hull of the enclosures of ratio * A and clip ratio * A, which contains the minimum PPO takes. A NaN input yields whole.

Reference:

Instances For

    Outward-rounded interval enclosure for fixed-horizon discounted returns.

    If you pass point intervals at the leaves (Binary.Interval.point), the output is a conservative enclosure for the exact real return recursion (interpreting leaves via Model.toReal after decoding).

    This is an executable diagnostic: you can run it alongside discountedReturnsChecked to detect blow-ups (endpoints becoming ±Inf or Valid failing).

    Reference:

    • Sutton and Barto, Reinforcement Learning: An Introduction (returns / bootstrapping).
    Instances For

      Outward-rounded interval enclosure for fixed-horizon $\operatorname{GAE}(\lambda)$.

      This is useful as a coarse numerical diagnostic alongside generalizedAdvantageEstimationChecked.

      Reference:

      Instances For