uvex_transients.phase_space.experiment.run_campaign#
- uvex_transients.phase_space.experiment.run_campaign(phase_map: ~uvex_transients.phase_space.map.PhaseSpaceMap, sampler: ~uvex_transients.phase_space.sampling.base.Sampler, rule: ~uvex_transients.phase_space.sampling.base.StoppingRule, campaign: ~uvex_transients.phase_space.experiment.CampaignSettings | None = None, *, map_fn: ~collections.abc.Callable = <class 'map'>, callback: ~collections.abc.Callable[[~uvex_transients.phase_space.map.PhaseSpaceMap], None] | None = None) PhaseSpaceMap[source]#
Measure points of a map until its budget is spent or it is converged.
The initial design is measured first if the map has fewer than
campaign.n_initialpoints. Each round then fits the model, asks the map for the next batch, and stops without spending the batch if the uncertainty is already belowcampaign.tolerance.- Parameters:
phase_map (
PhaseSpaceMap) – The map, which is added to. It can already hold points, in which case the campaign continues from them.sampler (
Sampler) – What measures a point. Its space has to be the map’s.rule (
StoppingRule) – How many tries a point gets. The map uses it to predict the noise of a point it has not measured.campaign (
CampaignSettings, optional) – How long to run, how many points to place per round, and the root seed of the measurements (seepoint_seed(); this is separate from the seed of the map, which is that of its designs and its model). By defaultCampaignSettings.from_configfor the kinds of the sampler.map_fn (
callable, optional) –map_fn(function, tasks)returning the results in order; replace it to measure a batch in parallel. The default is the builtin map. Because each point carries its own seed, the order does not matter.callback (
callable, optional) – Called with the map after the initial design and after every batch, for example to save a checkpoint.
- Returns:
The map that was passed in, now holding the new points and fitted.
- Return type:
- Raises:
ValueError – If the sampler’s space is not the map’s.