probly.representation.array_like.ArrayLike

class probly.representation.array_like.ArrayLike(*args, **kwargs)[source]

Bases: Protocol, Generic

Protocol for array-like objects.

Unlike numpy.typing.ArrayLike, this protocol does not only check whether an object can be converted to a numpy array, but rather whether it supports core indexing and shape/metadata operations similar to a numpy array. This protocol is based in the Python array API standard: https://data-apis.org/array-api Unlike the official standard, this protocol does not require support for all numerical operations.

property T: Any

Transposed array.

property device: Any

Device of the array.

property dtype: Any

Data type of the array.

property mT: Any

Matrix transposed array.

property ndim: int

Number of dimensions.

property shape: tuple[int, ...]

Shape of the array.

property size: int

Number of elements in the array.

to_device(device: Literal['cpu'], /, *, stream: int | Any | None = None) Self[source]

Move the array to a device.

Examples using probly.representation.array_like.ArrayLike

Plotting binary credal sets on an interval

Plotting binary credal sets on an interval

Plotting credal sets on the simplex

Plotting credal sets on the simplex

Plotting credal sets on a spider (radar) chart

Plotting credal sets on a spider (radar) chart

Convex credal set

Convex credal set

Discrete credal set

Discrete credal set

Distance-based credal set

Distance-based credal set

Probability-intervals credal set

Probability-intervals credal set

Working with ArraySample

Working with ArraySample

Singleton credal set

Singleton credal set

MC-Dropout uncertainty on a 2-D stream

MC-Dropout uncertainty on a 2-D stream