magni.cs.phase_transition._util module

Module providing the public function of the magni.cs.phase_transition subpackage.

magni.cs.phase_transition._util.determine(algorithm, path, label='default', overwrite=False, pre_simulation_hook=None)[source]

Determine the phase transition of a reconstruction algorithm.

The phase transition is determined from a number of monte carlo simulations on a delta-rho grid for a given problem suite.

Parameters:
  • algorithm (function) – A function handle to the reconstruction algorithm.
  • path (str) – The path of the HDF5 database where the results should be stored.
  • label (str) – The label assigned to the phase transition (the default is ‘default’).
  • overwrite (bool) – A flag indicating if an existing phase transition should be overwritten if it has the same path and label (the default is False).
  • pre_simulation_hook (callable) – A handle to a callable which should be run just before the call to the reconstruction algorithm (the default is None, which implies that no pre hook is run).

See also

magni.cs.phase_transition._simulation.run()
The actual simulation.
magni.cs.phase_transition._analysis.run()
The actual phase determination.

Notes

The pre_simulation_hook may be used to setup the simulation to match the specfic simulation parameters, e.g. if an oracle estimator is used in the reconstruction algorithm. The pre_simulation_hook takes one argument which is the locals() dict.

Examples

An example of how to use this function is provided in the examples folder in the cs-phase_transition.ipynb ipython notebook file.