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

Method getAlpha

src/python/handler/py_DMR.cpp:192–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192py::UniqueObj DMRModelObject::getAlpha() const
193{
194 auto* inst = getInst<tomoto::IDMRModel>();
195 float* ptr;
196 auto ret = py::newEmptyArray(ptr, inst->getK(), inst->getF());
197 for (size_t i = 0; i < inst->getK(); ++i)
198 {
199 auto l = inst->getLambdaByTopic(i);
200 Eigen::Map<Eigen::ArrayXf> ml{ l.data(), (Eigen::Index)l.size() };
201 ml = ml.exp() + inst->getAlphaEps();
202 memcpy(ptr + i * inst->getF(), l.data(), sizeof(float) * inst->getF());
203 }
204 return ret;
205}
206
207std::optional<std::string_view> DocumentObject::getMetadataFromDMR() const
208{

Callers

nothing calls this directly

Calls 5

newEmptyArrayFunction · 0.85
getLambdaByTopicMethod · 0.80
getKMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected