| 206 | } |
| 207 | |
| 208 | double getLLDocTopic(const _DocType& doc) const |
| 209 | { |
| 210 | const size_t V = this->realV; |
| 211 | const auto K = this->K; |
| 212 | |
| 213 | auto alphaDoc = getCachedAlpha(doc); |
| 214 | |
| 215 | Float ll = 0; |
| 216 | Float alphaSum = alphaDoc.sum(); |
| 217 | for (Tid k = 0; k < K; ++k) |
| 218 | { |
| 219 | ll += math::lgammaT(doc.numByTopic[k] + alphaDoc[k]); |
| 220 | ll -= math::lgammaT(alphaDoc[k]); |
| 221 | } |
| 222 | ll -= math::lgammaT(doc.getSumWordWeight() + alphaSum); |
| 223 | ll += math::lgammaT(alphaSum); |
| 224 | return ll; |
| 225 | } |
| 226 | |
| 227 | template<typename _DocIter> |
| 228 | double getLLDocs(_DocIter _first, _DocIter _last) const |
nothing calls this directly
no test coverage detected