本文整理汇总了C++中Gaussian::covarianceDiag方法的典型用法代码示例。如果您正苦于以下问题:C++ Gaussian::covarianceDiag方法的具体用法?C++ Gaussian::covarianceDiag怎么用?C++ Gaussian::covarianceDiag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gaussian
的用法示例。
在下文中一共展示了Gaussian::covarianceDiag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: store
// store the HMM into a file
void HMMState::store(FileOutput &file) {
// phonetic symbol
char strPhone[MAX_PHONETIC_SYMBOL_LENGTH+1];
memset(strPhone,0,MAX_PHONETIC_SYMBOL_LENGTH+1);
strcpy(strPhone,m_phoneSet->getStrPhone(m_iPhone));
IOBase::writeBytes(file.getStream(),reinterpret_cast<char*>(strPhone),MAX_PHONETIC_SYMBOL_LENGTH+1);
// state
IOBase::write(file.getStream(),m_iState);
// within word position (DEPRECATED)
IOBase::write(file.getStream(),m_iPosition);
// Gaussian components
int iGaussianComponents = m_gaussianMixture->getNumberComponents();
IOBase::write(file.getStream(),iGaussianComponents);
for(int iGaussian = 0 ; iGaussian < iGaussianComponents ; ++iGaussian) {
Gaussian *gaussian = (*m_gaussianMixture)(iGaussian);
IOBase::write(file.getStream(),gaussian->weight());
gaussian->mean().writeData(file.getStream());
if (m_iCovarianceModeling == COVARIANCE_MODELLING_TYPE_DIAGONAL) {
gaussian->covarianceDiag().writeData(file.getStream());
} else {
gaussian->covarianceFull().writeData(file.getStream());
}
}
}
示例2: load
// load the HMM from a file
void HMMState::load(FileInput &file, unsigned char iEstimationMethod) {
// phonetic symbol
char strPhone[MAX_PHONETIC_SYMBOL_LENGTH+1];
IOBase::readBytes(file.getStream(),reinterpret_cast<char*>(strPhone),MAX_PHONETIC_SYMBOL_LENGTH+1);
m_iPhone = m_phoneSet->getPhoneIndex(strPhone);
assert(m_iPhone != UCHAR_MAX);
// state
IOBase::read(file.getStream(),&m_iState);
assert(m_iState < NUMBER_HMM_STATES);
// within word position (DEPRECATED)
IOBase::read(file.getStream(),&m_iPosition);
// Gaussian components
int iGaussianComponents = -1;
IOBase::read(file.getStream(),&iGaussianComponents);
for(int iGaussian = 0 ; iGaussian < iGaussianComponents ; ++iGaussian) {
Gaussian *gaussian = new Gaussian(m_iDim,m_iCovarianceModeling);
IOBase::read(file.getStream(),&gaussian->weight());
gaussian->mean().readData(file.getStream());
if (m_iCovarianceModeling == COVARIANCE_MODELLING_TYPE_DIAGONAL) {
gaussian->covarianceDiag().readData(file.getStream());
} else {
gaussian->covarianceFull().readData(file.getStream());
}
m_gaussianMixture->addGaussianComponent(gaussian);
}
}