mcmc_anneal

Contents

mcmc_anneal#

graph_tool.inference.mcmc_anneal(state, beta_range=(1.0, 10.0), niter=100, history=False, mcmc_equilibrate_args={}, verbose=False)[source]#

Equilibrate a MCMC at a specified target temperature by performing simulated annealing.

Parameters:
stateAny state class (e.g. BlockState)

Initial state. This state will be modified during the algorithm.

beta_rangetuple of two floats (optional, default: (1., 10.))

Inverse temperature range.

niterint (optional, default: 100)

Number of steps (in logspace) from the starting temperature to the final one.

historybool (optional, default: False)

If True, a list of tuples of the form (nattempts, nmoves, beta, entropy)

mcmc_equilibrate_argsdict (optional, default: {})

Arguments to be passed to mcmc_equilibrate().

verbosebool or tuple (optional, default: False)

If True, progress information will be shown. Optionally, this accepts arguments of the type tuple of the form (level, prefix) where level is a positive integer that specifies the level of detail, and prefix is a string that is prepended to the all output messages.

Returns:
historylist of tuples of the form (nattempts, nmoves, beta, entropy)

Summary of the MCMC run. This is returned only if history == True.

entropyfloat

Current entropy value after run. This is returned only if history == False.

nattemptsint

Number of node move attempts.

nmovesint

Number of node moves.

Notes

This algorithm employs exponential cooling, where the value of beta is multiplied by a constant at each iteration, so that starting from beta_range[0] the value of beta_range[1] is reached after niter iterations.

At each iteration, the function mcmc_equilibrate() is called with the current value of beta (via the mcmc_args parameter).

References

[peixoto-efficient-2014]

Tiago P. Peixoto, “Efficient Monte Carlo and greedy heuristic for the inference of stochastic block models”, Phys. Rev. E 89, 012804 (2014), DOI: 10.1103/PhysRevE.89.012804 [sci-hub, @tor], arXiv: 1310.4378