rexfw.convenience package¶
Submodules¶
Module contents¶
Convenient functions creating default objects to simplify standard tasks with this framework
-
rexfw.convenience.create_default_AMDRENS_params(schedule, n_steps, timesteps, collision_probability=0.1, update_interval=1)[source]¶
-
rexfw.convenience.create_default_HMCStepRENS_params(schedule, n_intermediate_steps, hmc_traj_length, n_hmc_iterations, timesteps)[source]¶
-
rexfw.convenience.create_default_RE_params(n_replicas)[source]¶ Creates default RE exchange parameters
Parameters: n_replicas (int) – the number of replicas Returns: a list of parameter objects holding information required to perform swaps Return type: list of ExchangeParams
-
rexfw.convenience.create_default_stats_elements(replica_names, variable_name)[source]¶ Creates default sampling statistics “elements”, each representing a tracked quantity such as acceptance rate, step size etc.
Parameters: replica_names (list) – a list of all replica names Returns: MCMC acceptance rate, RE acceptance rate and step size quantity objects Return type: tuple
-
rexfw.convenience.create_default_stats_writers(sim_path, variable_name)[source]¶ Creates default statistics writers, which print sampling statistics on the screen or write it to a text file
Parameters: Returns: default MCMC and RE statistics writers
Return type:
-
rexfw.convenience.setup_default_re_master(n_replicas, sim_path, comm)[source]¶ Creates a default
ExchangeMasterobject for Replica Exchange. This should suffice for most applications.Parameters: - n_replicas (int) – the number of replicas
- sim_path (str) – the folder where simulation output will be stored
- comm (
AbstractCommunicator) – aAbstractCommunicatorobject responsible for communication with the replicas
Returns: a for all practical purposes sufficient
ExchangeMasterobjectReturn type:
-
rexfw.convenience.setup_default_replica(init_state, pdf, sampler_class, sampler_params, output_folder, comm, rank)[source]¶ Creates a default
Replicaobject for replica exchange. This should suffice for most applications.Parameters: - init_state (depends on your application) – initial state for the replica
- pdf (
AbstractPDF) – aAbstractPDFobject which describes the probability density the replica will sample - sampler_class (
AbstractSampler) – the class of the sampler used to sample from this replica’s PDF - sampler_params (dict) – a dict containing additional keyword arguments your sampler might need
- output_folder (str) – the folder where simulation output will be stored
- comm (
AbstractCommunicator) – aAbstractCommunicatorobject responsible for communication with the master object - rank (int) – the index of this replica, usually 1, 2, …
Returns: a for all practical purposes sufficient
ReplicaobjectReturn type: