| 190 | } |
| 191 | |
| 192 | py::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 | |
| 207 | std::optional<std::string_view> DocumentObject::getMetadataFromDMR() const |
| 208 | { |
nothing calls this directly
no test coverage detected