inpho / vsm

Vector Space Model Framework developed for InPhO
http://inpho.github.io/vsm
Other
35 stars 14 forks source link

np.log runtime warnings #166

Open JaimieMurdock opened 6 years ago

JaimieMurdock commented 6 years ago

There are warnings in the np.log calculations in ldacgsmulti:

/home/jammurdo/anaconda3/lib/python3.6/site-packages/vsm/mode/lldacgsmulti.py:435: RuntimeWarning: divide by zero encountered in log
  log_kc = np.log(top_doc / top_doc.sum(0)[np.newaxis, :])
/home/jammurdo/anaconda3/lib/python3.6/site-packages/vsm/model/ldacgsmulti.py:461: RuntimeWarning: divide by zero encountered in log
  mtrand_state[4])
/home/jammurdo/anaconda3/lib/python3.6/site-packages/vsm/model/ldacgsmulti.py:434: RuntimeWarning: divide by zero encountered in log
  log_wk = np.log(gbl_word_top * inv_top_sums[np.newaxis, :])

Perhaps a consequence of using single-precision vectors, perhaps a consequence of an integer<->float miscast.