Commit e06247f5 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

inference: Remove "sequential" parameter from multiflip MCMC

parent 174587ec
......@@ -44,7 +44,6 @@ using namespace std;
((mproposals, & ,std::vector<size_t>&, 0)) \
((maccept, & ,std::vector<size_t>&, 0)) \
((allow_vacate,, bool, 0)) \
((sequential,, bool, 0)) \
((verbose,, bool, 0)) \
((niter,, size_t, 0))
......@@ -72,7 +71,8 @@ struct MCMC
_groups(num_vertices(_state._bg)),
_vpos(get(vertex_index_t(), _state._g),
num_vertices(_state._g)),
_mprobs(num_vertices(_state._g) + 1)
_mprobs(num_vertices(_state._g) + 1),
_sequential(false)
{
_state.init_mcmc(_c,
(_entropy_args.partition_dl ||
......@@ -98,6 +98,8 @@ struct MCMC
std::vector<size_t> _vs;
std::vector<double> _mprobs;
bool _sequential;
size_t node_state(size_t r)
{
return r;
......
......@@ -1212,8 +1212,7 @@ class BlockState(object):
def multiflip_mcmc_sweep(self, beta=1., a=1, c=1., niter=1, entropy_args={},
allow_vacate=True, sequential=True, verbose=False,
**kwargs):
allow_vacate=True, verbose=False, **kwargs):
r"""Perform ``niter`` sweeps of a Metropolis-Hastings acceptance-rejection
sampling MCMC with multiple moves to sample network partitions.
......@@ -1239,12 +1238,6 @@ class BlockState(object):
:meth:`graph_tool.inference.BlockState.entropy`.
allow_vacate : ``bool`` (optional, default: ``True``)
Allow groups to be vacated.
sequential : ``bool`` (optional, default: ``True``)
If ``sequential == True`` each vertex move attempt is made
sequentially, where vertices are visited in random order. Otherwise
the moves are attempted by sampling vertices randomly, so that the
same vertex can be moved more than once, before other vertices had
the chance to move.
verbose : ``bool`` (optional, default: ``False``)
If ``verbose == True``, detailed information will be displayed.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment