NumpyGaussianDistribution¶
- class probly.representation.distribution.numpy_gaussian.NumpyGaussianDistribution(mean: ndarray, var: ndarray, type: Literal['gaussian'] = 'gaussian')[source]¶
Bases:
NumpyAxisProtected[ndarray],GaussianDistribution[ndarray]Gaussian distribution with array parameters.
- 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) Self[source]¶
Cast each protected field using ndarray.astype’s casting and layout options.
- property flags: ArrayFlagsLike¶
The flags of the array.
- mean: np.ndarray¶
- permitted_functions = {}¶
- permitted_ufuncs = {}¶
- protected_values(func: Callable | None = None, method: str | None = None) dict[str, NumpyProtectedValue] | None[source]¶
Return all protected field values.
The values are preserved as-is and are not coerced to
np.ndarray. Optionally takes the function that triggered the call for context. This can be used to conditionally modify the returned values or prevent them from being accessed.
- 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) Self[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).
- transpose(*axes: int | None) Self[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: Literal['gaussian']¶
- var: np.ndarray¶