Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
836b86fb
Commit
836b86fb
authored
Jun 16, 2020
by
Tiago Peixoto
Browse files
Fix entropy_args in PartitionCentroidState and ModeClusterState
parent
89bcbbf6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/inference/partition_centroid.py
View file @
836b86fb
...
...
@@ -109,6 +109,7 @@ class PartitionCentroidState(object):
network partitions. See
:meth:`graph_tool.inference.blockmodel.BlockState.mcmc_sweep` for the
parameter documentation. """
oentropy_args
=
"."
mcmc_state
=
DictState
(
locals
())
mcmc_state
.
vlist
=
Vector_size_t
()
mcmc_state
.
vlist
.
resize
(
len
(
self
.
b
))
...
...
@@ -141,17 +142,20 @@ class PartitionCentroidState(object):
return
dS
,
nattempts
,
nmoves
def
multiflip_mcmc_sweep
(
self
,
beta
=
1.
,
psingle
=
100
,
psplit
=
1
,
pmerge
=
1
,
def
multiflip_mcmc_sweep
(
self
,
beta
=
1.
,
psingle
=
None
,
psplit
=
1
,
pmerge
=
1
,
pmergesplit
=
1
,
d
=
0.01
,
gibbs_sweeps
=
10
,
niter
=
1
,
accept_stats
=
None
,
verbose
=
False
,
**
kwargs
):
r
"""Perform sweeps of a merge-split Metropolis-Hastings rejection sampling MCMC
to sample network partitions. See
:meth:`graph_tool.inference.blockmodel.BlockState.mcmc_sweep` for the
parameter documentation."""
if
psingle
is
None
:
psingle
=
len
(
self
.
b
)
gibbs_sweeps
=
max
(
gibbs_sweeps
,
1
)
nproposal
=
Vector_size_t
(
4
)
nacceptance
=
Vector_size_t
(
4
)
force_move
=
kwargs
.
pop
(
"force_move"
,
False
)
oentropy_args
=
"."
mcmc_state
=
DictState
(
locals
())
mcmc_state
.
state
=
self
.
_state
mcmc_state
.
c
=
0
...
...
src/graph_tool/inference/partition_modes.py
View file @
836b86fb
...
...
@@ -459,6 +459,7 @@ class ModeClusterState(object):
:meth:`graph_tool.inference.blockmodel.BlockState.mcmc_sweep` for the
parameter documentation. """
oentropy_args
=
"."
mcmc_state
=
DictState
(
locals
())
mcmc_state
.
vlist
=
Vector_size_t
()
mcmc_state
.
vlist
.
resize
(
len
(
self
.
b
))
...
...
@@ -501,6 +502,7 @@ class ModeClusterState(object):
nproposal
=
Vector_size_t
(
4
)
nacceptance
=
Vector_size_t
(
4
)
force_move
=
kwargs
.
pop
(
"force_move"
,
False
)
oentropy_args
=
"."
mcmc_state
=
DictState
(
locals
())
mcmc_state
.
state
=
self
.
_state
mcmc_state
.
c
=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment