Commit 195526cf authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

inference.blockmodel: Fix issue with ignore_degrees

parent 6ad35ea3
Pipeline #218 failed with stage
in 201 minutes and 52 seconds
......@@ -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 (_brecsum[r] > 0)
if (_bignore_degrees[r] > 0)
S += -positive_w_log_P(_mrp[r], _brecsum[r], _alpha, _beta);
}
break;
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment