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

Method optimizeParameters

src/TopicModel/CTModel.hpp:184–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182 }
183
184 void optimizeParameters(ThreadPool& pool, _ModelState* localData, _RandGen* rgs)
185 {
186 std::vector<std::future<void>> res;
187 topicPrior = math::MultiNormalDistribution<Float>::estimate([this](size_t i)
188 {
189 return this->docs[i / numBetaSample].beta.col(i % numBetaSample);
190 }, this->docs.size() * numBetaSample);
191 if (!std::isfinite(topicPrior.mean[0]))
192 THROW_ERROR_WITH_INFO(exc::TrainingError,
193 text::format("topicPrior.mean is %f", topicPrior.mean[0]));
194 }
195
196 template<typename _DocIter>
197 double getLLDocs(_DocIter _first, _DocIter _last) const

Callers

nothing calls this directly

Calls 2

formatFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected