probly.representation.credal_set.torch.TorchProbabilityIntervalsCredalSet¶
- class probly.representation.credal_set.torch.TorchProbabilityIntervalsCredalSet(lower_bounds: Tensor, upper_bounds: Tensor)[source]¶
Bases:
TorchAxisProtected[Any],TorchCategoricalCredalSet,ProbabilityIntervalsCredalSetCredal set represented by lower/upper categorical bounds.
- property barycenter: TorchCategoricalDistribution¶
Return the barycenter of the credal set.
- clone(*, memory_format: memory_format = torch.preserve_format) Self[source]¶
Return a copy of the array.
- contains(probabilities: Tensor) Tensor[source]¶
Check whether probabilities are inside the intervals.
- cpu(memory_format: memory_format = torch.preserve_format) Self[source]¶
Move the array to the CPU.
- cuda(device: device | str | None = None, non_blocking: bool = False, memory_format: memory_format = torch.preserve_format) Self[source]¶
Move the array to the GPU.
- classmethod from_sample(sample: Sample[TorchCategoricalDistribution]) Self[source]¶
Create a credal set from a finite sample.
- Parameters:
sample – The sample to create the credal set from.
- Returns:
The created credal set.
- classmethod from_torch_sample(sample: TorchSample[TorchCategoricalDistribution]) Self[source]¶
Create a credal set from categorical distribution samples.
- lower_bounds: torch.Tensor¶
- permitted_functions = {}¶
- permute(*dims: Size | int | tuple[int] | list[int]) Self[source]¶
Return a permuted version of the array.
- protected_values(func: Callable | None = None) dict[str, TorchProtectedValue] | None[source]¶
Return all protected field values as-is.
Optionally takes the torch function that triggered the call for context. This can be used to conditionally modify the returned values or prevent them from being accessed.
- size(dim: int | None = None) int | Size[source]¶
Return the size of the array along the given dimension.
- to_device(device: Literal['cpu'], /, *, stream: int | Any | None = None) Self[source]¶
Move the array to a device.
- type = 'categorical'¶
- upper_bounds: torch.Tensor¶