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:
objectDataset class for multi-outcome data.
Methods
Load data from a given input file.
Return the minimum objective value of the dataset.
Return the number of components of the latent space.
Add a point to the dataset.
Save all dataset data to a file.
Move the dataset to a given device.
Transform outcomes to the latent standardised space.
Transform outcomes back to the original space.
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.