piglot.utils.scalarisations.MonteCarloScalarisation

class MonteCarloScalarisation(objectives: List[IndividualObjective], num_samples: int = 512, seed: int | None = None)[source]

Bases: Scalarisation, ABC

Base class for non-linear scalarisations requiring Monte Carlo variance estimations.

Methods

scalarise

Scalarise a set of objectives.

scalarise_torch

Scalarise a set of objectives with gradients.

scalarise(values: ndarray, variances: ndarray | None = None) Tuple[float, float | None]

Scalarise a set of objectives.

Parameters

valuesnp.ndarray

Mean objective values.

variancesOptional[np.ndarray]

Optional variances of the objectives.

Returns

Tuple[float, Optional[float]]

Mean and variance of the scalarised objective.

scalarise_torch(values: Tensor, variances: Tensor | None = None) Tuple[Tensor, Tensor | None][source]

Scalarise a set of objectives with gradients.

Parameters

valuestorch.Tensor

Mean objective values.

variancesOptional[torch.Tensor]

Optional variances of the objectives.

Returns

Tuple[torch.Tensor, Optional[torch.Tensor]]

Mean and variance of the scalarised objective.