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
ffac9b09
Commit
ffac9b09
authored
Jun 25, 2016
by
Tiago Peixoto
Browse files
NestedBlockState.mcmc_sweep(): add support for different parameters for different levels
parent
813cf5c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/inference/nested_blockmodel.py
View file @
ffac9b09
...
...
@@ -443,6 +443,10 @@ class NestedBlockState(object):
dS
=
0
nmoves
=
0
c
=
kwargs
.
get
(
"c"
,
None
)
if
c
is
not
None
and
not
isinstance
(
c
,
collections
.
Iterable
):
c
=
[
c
]
*
len
(
self
.
levels
)
for
l
in
range
(
len
(
self
.
levels
)):
if
check_verbose
(
verbose
):
print
(
verbose_pad
(
verbose
)
+
"level:"
,
l
)
...
...
@@ -468,7 +472,13 @@ class NestedBlockState(object):
if
l
<
len
(
self
.
levels
)
-
1
:
self
.
levels
[
l
+
1
].
_state
.
sync_emat
()
ret
=
algo
(
self
.
levels
[
l
],
**
overlay
(
kwargs
,
entropy_args
=
eargs
))
if
c
is
None
:
args
=
overlay
(
kwargs
,
entropy_args
=
eargs
)
else
:
args
=
overlay
(
kwargs
,
entropy_args
=
eargs
,
c
=
c
[
l
])
ret
=
algo
(
self
.
levels
[
l
],
**
args
)
dS
+=
ret
[
0
]
nmoves
+=
ret
[
1
]
...
...
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