MCPcopy Create free account
hub / github.com/bab2min/tomotopy / getZLikelihoods

Method getZLikelihoods

src/TopicModel/CTModel.hpp:47–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45
46 template<bool _asymEta>
47 Float* getZLikelihoods(_ModelState& ld, const _DocType& doc, size_t docId, size_t vid) const
48 {
49 const size_t V = this->realV;
50 assert(vid < V);
51 auto etaHelper = this->template getEtaHelper<_asymEta>();
52 auto& zLikelihood = ld.zLikelihood;
53 zLikelihood = doc.smBeta.array()
54 * (ld.numByTopicWord.col(vid).array().template cast<Float>() + etaHelper.getEta(vid))
55 / (ld.numByTopic.array().template cast<Float>() + etaHelper.getEtaSum());
56 sample::prefixSum(zLikelihood.data(), this->K);
57 return &zLikelihood[0];
58 }
59
60 void updateBeta(_DocType& doc, _RandGen& rg) const
61 {

Callers

nothing calls this directly

Calls 4

prefixSumFunction · 0.85
getEtaMethod · 0.45
getEtaSumMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected