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
0aee04a4
Commit
0aee04a4
authored
Apr 14, 2016
by
Tiago Peixoto
Browse files
inference: fix potential issue with get_move_prob()
parent
952d299b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/graph/inference/graph_blockmodel.hh
View file @
0aee04a4
...
...
@@ -890,11 +890,7 @@ public:
size_t
ew
=
_eweight
[
e
];
w
+=
ew
;
int
mts
;
if
(
t
==
r
&&
s
==
size_t
(
_b
[
u
]))
mts
=
_mrs
[
_emat
.
get_bedge
(
e
)];
else
mts
=
get_mrs
(
t
,
s
,
_mrs
,
_emat
);
int
mts
=
get_mrs
(
t
,
s
,
_mrs
,
_emat
);
int
mtp
=
_mrp
[
t
];
int
mst
=
mts
;
int
mtm
=
mtp
;
...
...
@@ -947,6 +943,9 @@ public:
double
get_move_prob
(
size_t
v
,
size_t
r
,
size_t
s
,
double
c
,
bool
reverse
)
{
_m_entries
.
clear
();
move_entries
(
v
,
(
reverse
)
?
r
:
s
,
_b
,
_eweight
,
_mrs
,
_emat
.
get_bedge_map
(),
_g
,
_bg
,
_m_entries
);
return
get_move_prob
(
v
,
r
,
s
,
c
,
reverse
,
_m_entries
);
}
...
...
src/graph_tool/inference/blockmodel.py
View file @
0aee04a4
...
...
@@ -679,7 +679,10 @@ class BlockState(object):
``reverse == True``, the reverse probability of moving the node back
from block ``s`` to its current one is obtained.
"""
return
self
.
_state
.
get_move_prob
(
int
(
v
),
self
.
b
[
v
],
s
,
c
,
reverse
)
if
not
reverse
:
return
self
.
_state
.
get_move_prob
(
int
(
v
),
self
.
b
[
v
],
s
,
c
,
False
)
else
:
return
self
.
_state
.
get_move_prob
(
int
(
v
),
s
,
self
.
b
[
v
],
c
,
True
)
def
get_edges_prob
(
self
,
edge_list
,
missing
=
True
,
entropy_args
=
{}):
"""Compute the log-probability of the missing (or spurious if ``missing=False``)
...
...
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