TemperingState#

class graph_tool.inference.TemperingState(states, betas, idx=None, beta_dl=False)[source]#

Bases: object

This class aggregates several state classes and corresponding inverse-temperature values to implement parallel tempering MCMC.

This is meant to be used with mcmc_equilibrate().

Parameters:
stateslist of state objects (e.g. BlockState)

Initial parallel states.

betaslist of floats

Inverse temperature values.

Methods

entropies(**kwargs)

Returns the entropies of the parallel states.

entropy(**kwargs)

Returns the sum of the entropy of the parallel states.

gibbs_sweep(**kwargs)

Perform a full Gibbs mcmc sweep of the parallel states, where swap or moves are chosen randomly.

mcmc_sweep(**kwargs)

Perform a full mcmc sweep of the parallel states, where swap or moves are chosen randomly.

multiflip_mcmc_sweep(**kwargs)

Perform a full mcmc sweep of the parallel states, where swap or moves are chosen randomly.

states_move(sweep_algo, **kwargs)

Perform a full sweep of the parallel states, where state moves are attempted by calling sweep_algo(state, beta=beta, **kwargs).

states_swap(**kwargs)

Perform a full sweep of the parallel states, where swaps are attempted.

entropies(**kwargs)[source]#

Returns the entropies of the parallel states. All keyword arguments are propagated to the individual states’ entropy() method.

entropy(**kwargs)[source]#

Returns the sum of the entropy of the parallel states. All keyword arguments are propagated to the individual states’ entropy() method.

gibbs_sweep(**kwargs)[source]#

Perform a full Gibbs mcmc sweep of the parallel states, where swap or moves are chosen randomly. It accepts an keyword argument r (default: 0.1) specifying the relative probability with which state swaps are performed with respect to node moves. All remaining keyword arguments are propagated to the individual states’ gibbs_sweep() method.

mcmc_sweep(**kwargs)[source]#

Perform a full mcmc sweep of the parallel states, where swap or moves are chosen randomly. It accepts an keyword argument r (default: 0.1) specifying the relative probability with which state swaps are performed with respect to node moves. All remaining keyword arguments are propagated to the individual states’ mcmc_sweep() method.

multiflip_mcmc_sweep(**kwargs)[source]#

Perform a full mcmc sweep of the parallel states, where swap or moves are chosen randomly. It accepts an keyword argument r (default: 0.1) specifying the relative probability with which state swaps are performed with respect to node moves. All remaining keyword arguments are propagated to the individual states’ mcmc_sweep() method.

states_move(sweep_algo, **kwargs)[source]#

Perform a full sweep of the parallel states, where state moves are attempted by calling sweep_algo(state, beta=beta, **kwargs).

states_swap(**kwargs)[source]#

Perform a full sweep of the parallel states, where swaps are attempted. All relevant keyword arguments are propagated to the individual states’ entropy() method.