premgopalan / svinet

Efficient discovery of overlapping communities in massive networks PK Gopalan, DM Blei Proceedings of the National Academy of Sciences 110 (36), 14534-14539
GNU General Public License v3.0
73 stars 35 forks source link

A quesiton about the function "PhiComp::update_phis(bool is_phi1)" in "mmsbinfer.hh" #3

Closed crescentluna closed 10 years ago

crescentluna commented 10 years ago
double u = .0;
if (_y == 1)
{
     u = (1 - b[k]) * _env.logepsilon;
 }
const double ** const elogpid = _Elogpi.const_data();
anext[k] = elogpid[c][k] + (_Elogf[k] * b[k]) + u;

I got puzzled when reading this code in iterations of the function "PhiComp::update_phis(bool is_phi1)" in mmsbinfer.hh. According to the paper, when y==0,u is supposed be (1 - b[k]) *log(1-epsilon), but this case is not considered here.

premgopalan commented 10 years ago

Ah, you want to be looking at linksampling.cc/hh or fastamm.cc/hh. does that help?

crescentluna commented 10 years ago

The same cases in: 1.inline void FPhiComp::update_phis(bool is_phi1) in fastamm.hh 2.inline void PhiCompute::update_phis(bool is_phi1) in fastamm2.hh 3.inline void PhiComp::update_phis(bool is_phi1) in mmsbinfer.hh According to Eq.S10 in SI, when y==0,u is supposed be (1 - b[k]) *log(1-epsilon), but here u is set to zero by default. Maybe I misunderstand the codes. I wonder I should read more. By the way,thanks for the nice paper:-).

premgopalan commented 10 years ago

"y==0,u is supposed be (1 - b[k]) *log(1-epsilon)"

epsilon is set to 1e-30, so this term is 0.

crescentluna commented 10 years ago

Got it ! It's really a stupid question. Thanks a lot:).