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
63e23b1d
Commit
63e23b1d
authored
Apr 21, 2015
by
Tiago Peixoto
Browse files
Fix bug with model selection in nested_blockmodel.py
parent
3ad8fbf8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/community/nested_blockmodel.py
View file @
63e23b1d
...
...
@@ -677,6 +677,8 @@ def replace_level(l, state, min_B=None, max_B=None, max_b=None, nsweeps=10,
nested_dl
=
l
<
len
(
state
.
levels
)
-
1
state
.
levels
[
l
].
clabel
.
a
=
cclabel
.
a
Sb
=
get_b_dl
(
state
.
levels
[
l
],
dense
=
(
l
>
0
and
state
.
deg_corr
!=
"full"
)
or
dense
,
multigraph
=
l
>
0
or
multigraph
,
...
...
@@ -684,6 +686,8 @@ def replace_level(l, state, min_B=None, max_B=None, max_b=None, nsweeps=10,
nested_overlap
=
state
.
overlap
==
"full"
,
dl_ent
=
dl_ent
)
state
.
levels
[
l
].
clabel
.
a
=
0
if
_bm_test
():
assert
clabel
.
a
.
max
()
+
1
<=
min_B
...
...
@@ -744,12 +748,6 @@ def replace_level(l, state, min_B=None, max_B=None, max_b=None, nsweeps=10,
assert
(
res
.
clabel
.
a
==
cclabel
.
a
).
all
(),
(
res
.
clabel
.
a
,
cclabel
.
a
)
assert
res
.
_BlockState__check_clabel
(),
"invalid clabel after minimize!"
res
.
clabel
.
a
=
0
if
state
.
ec
is
not
None
:
for
s
in
res
.
states
:
s
.
clabel
.
a
=
0
b
=
res
.
b
Sf
=
get_b_dl
(
res
,
dense
=
(
l
>
0
and
state
.
deg_corr
!=
"full"
)
or
dense
,
multigraph
=
l
>
0
or
multigraph
,
...
...
@@ -757,6 +755,12 @@ def replace_level(l, state, min_B=None, max_B=None, max_b=None, nsweeps=10,
nested_overlap
=
state
.
overlap
==
"full"
,
dl_ent
=
dl_ent
)
res
.
clabel
.
a
=
0
if
state
.
ec
is
not
None
:
for
s
in
res
.
states
:
s
.
clabel
.
a
=
0
b
=
res
.
b
kept
=
False
if
Sf
-
Sb
>=
-
1e-10
:
kept
=
True
...
...
Write
Preview
Supports
Markdown
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