public

jaxns.experimental.public

Module Contents

class GlobalOptimisation[source]

A global optimiser using nested sampling as the core algorithm. Can easily globally optimise complex models, with curving degeneracies and multimodal structure. Highly parallelisable. Recommended to use gradient information by setting gradient_slice=True.

Note, the log-likelihood over the model is maximised NOT the posterior. The prior acts as the search space prior, by constraining the search space and giving search preference to regions of high prior probability. Thus, the prior should encode your prior belief about where you think the global maximum is located.

Parameters:
  • model – a model to perform global optimisation on over the sample space.

  • num_search_chains – number of search chains to use.

  • s – number of slices to use per dimension.

  • k – number of phantom samples to use.

  • gradient_slice – if true use gradient information to improve. Default True.

  • shell_frac – fraction of the shell to discard in parallel.

  • devices – devices to use for parallel sharded computation. Default all available devices.

  • verbose – whether to print verbose output. Default False.

model: jaxns.framework.bases.BaseAbstractModel[source]
num_search_chains: int | None = None[source]
s: int | None = None[source]
k: int | None = None[source]
gradient_slice: bool = True[source]
shell_frac: float | None = None[source]
devices: jaxlib.xla_client.Device | None = None[source]
verbose: bool = False[source]
__post_init__()[source]
__call__(key, term_cond=None, finetune=False)[source]

Runs the global optimisation.

Parameters:
Returns:

results of the global optimisation

Return type:

jaxns.experimental.GlobalOptimisationResults

DefaultGlobalOptimisation[source]