PhaseSpaceMap#

class uvex_transients.phase_space.map.PhaseSpaceMap(space: Space, *, acquisition: str | None = None, n_candidates: int | None = None, floor: float | None = None, n_restarts: int | None = None, kernel=None, seed: int | SeedSequence | None = None, table: Table | None = None)[source]#

The measured points of a map and the Gaussian process model of the success fraction over their space.

Every argument that is None (the default) takes config["phase_space.campaign.<name>"].

Parameters:
  • space (Space) – The axes the map is over, with the ranges it covers. Any number of axes.

  • acquisition ({"variance", "imse"}, optional) – The acquisition rule; see the module documentation.

  • n_candidates (int, optional) – Size of the Sobol candidate set the acquisition is evaluated on each round.

  • floor (float, optional) – The success fraction \(\epsilon\) below which the log uncertainty is not chased.

  • n_restarts (int, optional) – Restarts of the kernel hyperparameter optimizer.

  • kernel (sklearn.gaussian_process.kernels.Kernel, optional) – Kernel on the unit cube, for the standardized logit. The default is an amplitude times an anisotropic Matern 5/2.

  • seed (int or numpy.random.SeedSequence, optional) – Seed for the designs, candidate sets and the kernel optimizer. Each of them draws a fresh child of it, so a map is reproducible but they do not share a stream.

  • table (astropy.table.Table, optional) – Previously measured points (see table) to start from.

Raises:

ValueError – If acquisition or floor is out of range, or table lacks a column of the space or k or n.

Methods

add(x, k, n, **extras)

Add a measured point.

estimate(x, *[, n_sigma])

Estimate the success fraction, with an interval, at points of any leading shape.

evaluate(x[, products, n_sigma])

Evaluate the success fraction and derived quantities at points of the space.

fit()

Fit the Gaussian process to every point measured so far.

grid_table(size[, products, bounds, n_sigma])

Evaluate the map on a regular grid, with its derived quantities, as one table.

initial_design(n)

Draw a scrambled Sobol design over the space, for the points measured before the first fit.

log_uncertainty(x)

Return the posterior standard deviation of \(\ln(p+\epsilon)\) at points of the space.

predict(x, *[, cov])

Predict the logit of the success fraction at points of the space.

propose(batch_size, expected_n)

Choose the next batch of points, fitting the model first.

recovery(x, *[, n_sigma])

Predict the success fraction, with an interval, at points of the space.

Attributes

points

The measured points in the coordinates of the space, shape (len(self), ndim).

settings

The settings of the model and the acquisition, as the constructor takes them.

space

The axes the map is over.

table

Every measured point, with the extra entries of its outcome as columns.