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
f03b9b48
Commit
f03b9b48
authored
May 20, 2022
by
Tiago Peixoto
Browse files
merge_split: fix issue with clabel
This fixes issue
#736
parent
b947294c
Changes
1
Show whitespace changes
Inline
Side-by-side
src/graph/inference/loops/merge_split.hh
View file @
f03b9b48
...
...
@@ -703,6 +703,8 @@ struct MergeSplit: public State
if
(
s
==
r
||
!
allow_merge
(
r
,
s
))
return
{
_null_group
,
0.
,
0.
,
0.
};
push_b
(
_groups
[
s
]);
double
pf
=
0
,
pb
=
0
;
if
(
!
std
::
isinf
(
_beta
))
{
...
...
@@ -755,7 +757,7 @@ struct MergeSplit: public State
auto
v
=
uniform_sample
(
_nodes
,
rng
);
auto
r
=
State
::
get_group
(
v
);
auto
s
=
State
::
sample_group
(
v
,
true
,
rng
);
if
(
r
==
s
)
if
(
r
==
s
||
!
State
::
allow_move
(
r
,
s
)
)
{
move
=
move_t
::
null
;
break
;
...
...
@@ -828,7 +830,7 @@ struct MergeSplit: public State
}
auto
r
=
uniform_sample
(
_rlist
,
rng
);
auto
s
=
sample_move
(
r
,
rng
);
if
(
!
allow_merge
(
r
,
s
))
if
(
s
==
r
||
!
allow_merge
(
r
,
s
))
{
move
=
move_t
::
null
;
break
;
...
...
@@ -890,7 +892,7 @@ struct MergeSplit: public State
{
while
(
!
_bstack
.
empty
())
pop_b
();
State
::
relax_update
(
tru
e
);
State
::
relax_update
(
fals
e
);
move
=
move_t
::
null
;
break
;
}
...
...
@@ -899,8 +901,6 @@ struct MergeSplit: public State
pf
+=
get
<
2
>
(
ret
);
pb
+=
get
<
3
>
(
ret
);
push_b
(
_groups
[
s
]);
ret
=
sample_split
(
s
,
r
,
rng
);
_dS
+=
get
<
1
>
(
ret
);
pf
+=
get
<
2
>
(
ret
);
...
...
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