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
195526cf
Commit
195526cf
authored
Oct 20, 2016
by
Tiago Peixoto
Browse files
inference.blockmodel: Fix issue with ignore_degrees
parent
6ad35ea3
Pipeline
#218
failed with stage
in 201 minutes and 52 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/graph/inference/graph_blockmodel.hh
View file @
195526cf
...
...
@@ -90,6 +90,7 @@ enum weight_type
((alpha,, double, 0)) \
((beta,, double, 0)) \
((ignore_degrees,, typename vprop_map_t<uint8_t>::type, 0)) \
((bignore_degrees,, typename vprop_map_t<uint8_t>::type, 0)) \
((allow_empty,, bool, 0))
GEN_STATE_BASE
(
BlockStateBase
,
BLOCK_STATE_params
)
...
...
@@ -1471,7 +1472,7 @@ public:
case
weight_type
::
DELTA_T
:
// waiting times
for
(
auto
r
:
vertices_range
(
_bg
))
{
if
(
_b
recsum
[
r
]
>
0
)
if
(
_b
ignore_degrees
[
r
]
>
0
)
S
+=
-
positive_w_log_P
(
_mrp
[
r
],
_brecsum
[
r
],
_alpha
,
_beta
);
}
break
;
...
...
src/graph_tool/inference/blockmodel.py
View file @
195526cf
...
...
@@ -363,10 +363,11 @@ class BlockState(object):
if
self
.
rec_type
==
libinference
.
rec_type
.
delta_t
:
# waiting times
self
.
brecsum
=
self
.
bg
.
degree_property_map
(
"out"
,
self
.
brec
)
mem
=
self
.
ignore_degrees
.
copy
()
bmem
=
self
.
get_bclabel
(
clabel
=
mem
)
self
.
brecsum
.
a
[
bmem
.
a
==
0
]
=
0
self
.
bignore_degrees
=
self
.
get_bclabel
(
clabel
=
mem
)
.
copy
(
"bool"
)
self
.
brecsum
.
a
[
self
.
bignore_degrees
.
a
==
0
]
=
0
else
:
self
.
brecsum
=
self
.
bg
.
new_vp
(
"double"
)
self
.
bignore_degrees
=
self
.
bg
.
new_vp
(
"bool"
)
self
.
rec_params
=
dict
(
m0
=
self
.
rec
.
fa
.
mean
(),
k0
=
1
,
v0
=
self
.
rec
.
fa
.
std
()
**
2
,
nu0
=
3
)
...
...
Oh-Hyun Kwon
@kwonoh
Mentioned in issue
#344 (closed)
·
Oct 20, 2016
Mentioned in issue
#344 (closed)
Mentioned in issue #344
Toggle commit list
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