AbstractConstraint
- class pmrf.constraints.AbstractConstraint
Bases:
ModuleThe base class for all physical constraints in Parax.
Constraints are a higher-level concept that provide bounds and bijectors over constrained domains. This is useful for use with unconstrained solvers (which require a bijector from the unconstrained real line to the constrained domain) and bounded solvers (which accept lower and upper bounds directly).
- Attributes:
bounds: A tuple containing the physical lower and upper bounds of the constrained space. bijector: A distreqx.bijectors.AbstractBijector mapping from the unconstrained real line to the physical space. base_bounds: A tuple containing the foundational, un-skewed orthogonal bounds. Where a
whitened base space exists this is the normalised box the optimizer works in, so that a step of a given size carries the same meaning along every axis: the unit box for an Interval, and the probability-integral-transform space for a constraint inferred from a distribution. For transformed constraints, this isolates the safe topological box before any dense correlations or skews are applied. It falls back to bounds only where no such normalisation exists, such as an unbounded or half-bounded domain.
- base_bijector: A distreqx.bijectors.AbstractBijector mapping from the orthogonal base_bounds
space into the physical bounds space. Defaults to Identity unless geometric skews are present.
- clip(value: PyTree) PyTree
Clip a value to lie within this constraint.
- is_outside(value: PyTree) PyTree
Returns if another value is outside the constraint.
- midpoint() PyTree
Returns the midpoint of the constraint.
Note that non-finite constraints may return infinity.
- base_bijector: AbstractVar[AbstractBijector]
- base_bounds: AbstractVar[tuple[PyTree, PyTree]]
- bijector: AbstractVar[AbstractBijector]
- bounds: AbstractVar[tuple[PyTree, PyTree]]