probly.representation.credal_set.torch.TorchCategoricalCredalSet

class probly.representation.credal_set.torch.TorchCategoricalCredalSet(*args, **kwargs)[source]

Bases: CategoricalCredalSet, ABC

Base class for torch-backed categorical credal sets.

abstract property barycenter: T

Return the barycenter of the credal set.

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.

abstractmethod classmethod from_torch_sample(sample: TorchSample[TorchCategoricalDistribution]) Self[source]

Create a credal set from categorical distribution samples.

abstract property num_classes: int

Return the number of classes in the credal set.

type: CredalSetType = 'categorical'