NumpyGaussianDistribution¶
- class probly.representation.distribution.numpy_gaussian.NumpyGaussianDistribution(mean: ndarray, var: ndarray)[source]¶
Bases:
NumpyAxisProtected[NumpyGaussianDistribution,NumpyGaussianDistribution | np.ndarray | float,NumpyGaussianDistribution,Never,NumpyGaussianDistribution,NDArray[bool],NumpyGaussianDistribution],GaussianDistribution[ndarray]Gaussian distribution with array parameters.
- property T: ShapeResultT¶
The transposed version of the underlying array.
- allowed_types: ClassVar[tuple[type[np.ndarray] | type[np.generic] | type[float] | type[int], ...]] = (<class 'numpy.ndarray'>, <class 'numpy.generic'>, <class 'float'>, <class 'int'>)¶
- astype(dtype: DTypeLike, order: Order = 'K', casting: Literal['no', 'equiv', 'safe', 'same_kind', 'unsafe'] = 'unsafe', subok: bool = True, copy: bool = True) OpResultT[source]¶
Cast each protected field using ndarray.astype’s casting and layout options.
- property flags: ArrayFlagsLike¶
The flags of the array.
- property mT: ShapeResultT¶
The transposed version of the underlying array.
- mean: np.ndarray¶
- permitted_functions = {}¶
- permitted_ufuncs = {}¶
- primary_protected_name = 'mean'¶
- protected_axes = {'mean': 0, 'var': 0}¶
- protected_values(func: Callable | None = None, method: str | None = None) dict[str, NumpyProtectedValue] | None[source]¶
Read effective values, with optional NumPy function or ufunc permissions.
- quantile(q: float | list[float] | ndarray) ndarray[source]¶
Calculate the quantile function at the given points.
- reshape(*shape: int | tuple[int, ...], order: str = 'C', copy: bool | None = None) ShapeResultT[source]¶
Return a copy with reshaped protected values.
- sample(num_samples: int = 1, rng: Generator | None = None) NumpySample[ndarray][source]¶
Draw samples and wrap them in an NumpySample (sample_axis=0).
- property shape: tuple[int, ...]¶
Read the logical shape without collecting fields unless all broadcast.
- transpose(*axes: int | Sequence[int] | None) ShapeResultT[source]¶
Return a transposed version of the NumpySample.
This method implicitly also provides full axis tracking support for - np.moveaxis - np.rollaxis Those functions call out to transpose methods for custom array types.
- Parameters:
axes – The axes to transpose.
- Returns:
A transposed version of the NumpySample.
- type: ClassVar[Literal['gaussian']] = 'gaussian'¶
- validate() None[source]¶
Raise if effective fields have insufficient rank or incompatible batches.
Call explicitly, or from __post_init__ to check dataclass construction. Fields owned by initialization (init=False) are excluded.
- var: np.ndarray¶