nnpd.nre.distributions¶
Distribution interfaces, independent bounded priors, and exact samplers.
Classes¶
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Uniform, truncated normal, bounded signed exponential, or grid per axis. |
Functions¶
|
Module Contents¶
- nnpd.nre.distributions.grid_axis(low: float, high: float, step: float) numpy.ndarray¶
- class nnpd.nre.distributions.Simulator¶
Bases:
abc.ABCHelper class that provides a standard way to create an ABC using inheritance.
- observation_dim: int¶
- abstractmethod sample(theta: numpy.ndarray, rng: numpy.random.Generator) numpy.ndarray¶
One observation per parameter row; result shape (…, observation_dim).
- abstractmethod log_likelihood(x: numpy.ndarray, theta: numpy.ndarray) numpy.ndarray¶
Optional exact reference, not used by the NRE training objective.
- class nnpd.nre.distributions.Prior¶
Bases:
abc.ABCHelper class that provides a standard way to create an ABC using inheritance.
- abstractmethod sample(size: int, rng: numpy.random.Generator) numpy.ndarray¶
Draw shape (size, number_of_inferred_parameters).
- abstractmethod log_prob(theta: numpy.ndarray) numpy.ndarray¶
Log density or log mass with respect to the declared support measure.
- property support_axes: tuple[numpy.ndarray | None, ...]¶
None means continuous; an array means discrete counting measure.
- property measure: str¶
- class nnpd.nre.distributions.IndependentPrior(parameters: tuple[Parameter, ...], definition: dict)¶
Bases:
PriorUniform, truncated normal, bounded signed exponential, or grid per axis.
A negative exponential rate is valid on a finite box; it is not an unbounded exponential distribution. Grid log_prob returns a mass, never a density. ‘by_parameter’ may override the default family for particular coordinates.
- families¶
- parameters¶
- kinds¶
- property support_axes¶
None means continuous; an array means discrete counting measure.
- sample(size: int, rng: numpy.random.Generator) numpy.ndarray¶
Draw shape (size, number_of_inferred_parameters).
- log_prob(theta: numpy.ndarray) numpy.ndarray¶
Log density or log mass with respect to the declared support measure.