本文整理汇总了C++中HMM::Dimensionality方法的典型用法代码示例。如果您正苦于以下问题:C++ HMM::Dimensionality方法的具体用法?C++ HMM::Dimensionality怎么用?C++ HMM::Dimensionality使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HMM
的用法示例。
在下文中一共展示了HMM::Dimensionality方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadHMM
void LoadHMM(HMM<distribution::GaussianDistribution>& hmm,
util::SaveRestoreUtility& sr)
{
std::string type;
size_t states;
sr.LoadParameter(type, "hmm_type");
if (type != "gaussian")
{
Rcpp::Rcout << "Cannot load non-Gaussian HMM (of type " << type << ") as "
<< "a Gaussian HMM!" << std::endl;
}
sr.LoadParameter(states, "hmm_states");
// Load transition matrix.
sr.LoadParameter(hmm.Transition(), "hmm_transition");
// Now each emission distribution.
hmm.Emission().resize(states);
for (size_t i = 0; i < states; ++i)
{
std::stringstream s;
s << "hmm_emission_mean_" << i;
sr.LoadParameter(hmm.Emission()[i].Mean(), s.str());
s.str("");
s << "hmm_emission_covariance_" << i;
sr.LoadParameter(hmm.Emission()[i].Covariance(), s.str());
}
hmm.Dimensionality() = hmm.Emission()[0].Mean().n_elem;
}