piglot.optimisers.botorch.dataset.BayesDataset

class BayesDataset(n_dim: int, n_outputs: int, export: str | None = None, dtype: dtype = torch.float64, std_tol: float = 1e-06, pca_variance: float | None = None, device: str = 'cpu')[source]

Bases: object

Dataset class for multi-outcome data.

Methods

load

Load data from a given input file.

min

Return the minimum objective value of the dataset.

numel_latent_space

Return the number of components of the latent space.

push

Add a point to the dataset.

save

Save all dataset data to a file.

to

Move the dataset to a given device.

transform_outcomes

Transform outcomes to the latent standardised space.

untransform_outcomes

Transform outcomes back to the original space.

update_stats

Update the statistics of the dataset.

classmethod load(filename: str) T[source]

Load data from a given input file.

Parameters

filenamestr

Path to the file to read from.

Returns

BayesDataset

Dataset loaded from the file.

min() Tuple[ndarray, ndarray][source]

Return the minimum objective value of the dataset.

Returns

Tuple[np.ndarray, np.ndarray]

Parameters and objective value for the minimum point.

numel_latent_space() int[source]

Return the number of components of the latent space.

Returns

int

Number of components of the latent space.

push(params: ndarray, results: ndarray, covariance: ndarray, objective: float | None) None[source]

Add a point to the dataset.

Parameters

paramsnp.ndarray

Parameter values for this observation.

resultObjectiveResult

Result for this observation.

save(filename: str) None[source]

Save all dataset data to a file.

Parameters

filenamestr

Output file path.

to(device: str) BayesDataset[source]

Move the dataset to a given device.

Parameters

devicestr

Device to move the dataset to.

Returns

BayesDataset

The dataset in the new device.

transform_outcomes(values: Tensor | None = None, covariances: Tensor | None = None, diagonalise: bool = True) Tuple[Tensor, Tensor][source]

Transform outcomes to the latent standardised space.

Parameters

valuestorch.Tensor

Values to transform.

covariancestorch.Tensor

Variances to transform.

diagonalisebool

Whether to diagonalise the covariance matrix (default: True).

Returns

Tuple[torch.Tensor, torch.Tensor]

Transformed values and variances.

untransform_outcomes(values: Tensor) Tensor[source]

Transform outcomes back to the original space.

Parameters

valuestorch.Tensor

Values to transform.

Returns

torch.Tensor

Transformed values.

update_stats() None[source]

Update the statistics of the dataset.