Run config#

Settings for how to run zfit.

zfit.run.set_graph_mode(*[, set_backend])

Set the policy for graph building and the usage of automatic vs numerical gradients.

zfit.run.set_autograd_mode()

Use automatic or numerical gradients.

zfit.run.clear_graph_cache()

Clear all generated graphs and effectively reset.

zfit.run.executing_eagerly()

Whether eager execution is enabled or not.

zfit.run.assert_executing_eagerly()

Assert that the execution is eager and Python side effects are taken into account.

zfit.run.set_n_cpu([strict])

Set the number of cpus to be used by zfit.

zfit.run.set_cpus_explicit(inter)

Set the number of threads (cpus) used for inter-op and intra-op parallelism.

Settings#

General settings for zfit

zfit.settings.set_seed(seed=None, numpy=None, backend=None, zfit=None)[source]#

Set random seed for zfit, numpy and the backend. If seed is given, this is used to generate deterministic seeds for numpy, zfit and the backend.

Notably, no python random seed is set.

Warning

To use this function to guarantee randomness, do not specify a seed. Use a seed _only_ for reproducibility: there have been unique cases of correlation between the seed and the result. As the seeds are returned, you can save them and rerun if needed.

Uses os.urandom to generate a seed if None is given, which guarantees cryptographically secure randomness.

Parameters:
  • seed (int, optional) – Seed to set for the random number generator of the seeds for within zfit. If None (default), the seed is set to a random value.

  • numpy (int, bool, optional) – Seed to set for numpy. If True (default), a random seed depending on the seed as used for zfit is used. If False, the seed is not set.

  • backend (int, bool, optional) – Seed to set for the backend. If True (default), a random seed depending on the seed as used for zfit is used. If False, the seed is not set.

  • zfit (int, bool, optional) – Seed to set for zfit. If True (default), a random seed is used. If False, the seed is not set.

Returns:

Seeds that were set, with the keys zfit, numpy, backend.

Return type:

dict