ywwbill / SupervisedLDA

Supervised LDA variations with tree priors and hinge loss
3 stars 0 forks source link

derivation of response term for conditional topic distribution #1

Closed mkarikom closed 4 years ago

mkarikom commented 4 years ago

On line 150-154 of SLDA.java, the following change to the conditional topic distribution:

if (type==TRAIN && labelStatuses[doc]) { score+=-MathUtil.sqr(labels[doc]-weight-eta[topic]/corpus.get(doc).docLength())/ (2.0*MathUtil.sqr(param.sigma)); }

Can you briefly explain where this comes from? Also curious whether this is the only published implementation of collapsed Gibbs EM sLDA? Thanks!

ywwbill commented 4 years ago

I derived the equations on my own, following the vanilla LDA's Gibbs sampling equation derivation in Parameter Estimation for Text Analysis.

I do not think this is the only implementation of collapsed Gibbs sLDA. This repo has another version of implementation.

mkarikom commented 4 years ago

Thanks for your reply! I will check out the references.