Adding methods for writing/reading of the OnlineGmmAdaptationState object

git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@5007 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
This commit is contained in:
Jan Trmal 2015-04-15 23:15:56 +00:00
Родитель 71ee38e894
Коммит cf90f50e07
3 изменённых файлов: 32 добавлений и 0 удалений

Просмотреть файл

@ -23,6 +23,27 @@
namespace kaldi {
void OnlineGmmAdaptationState::Read(std::istream &in_stream, bool binary) {
ExpectToken(in_stream, binary, "<ONLINEGMMADAPTATIONSTATE>");
ExpectToken(in_stream, binary, "<TRANSFORM>");
transform.Read(in_stream, binary);
ExpectToken(in_stream, binary, "<CMVNSTATS>");
cmvn_state.Read(in_stream, binary);
ExpectToken(in_stream, binary, "<SPKSTATS>");
spk_stats.Read(in_stream, binary, false);
ExpectToken(in_stream, binary, "</ONLINEGMMADAPTATIONSTATE>");
}
void OnlineGmmAdaptationState::Write(std::ostream &out_stream, bool binary) const {
WriteToken(out_stream, binary, "<ONLINEGMMADAPTATIONSTATE>");
WriteToken(out_stream, binary, "<TRANSFORM>");
transform.Write(out_stream, binary);
WriteToken(out_stream, binary, "<CMVNSTATS>");
cmvn_state.Write(out_stream, binary);
WriteToken(out_stream, binary, "<SPKSTATS>");
spk_stats.Write(out_stream, binary);
WriteToken(out_stream, binary, "</ONLINEGMMADAPTATIONSTATE>");
}
SingleUtteranceGmmDecoder::SingleUtteranceGmmDecoder(
const OnlineGmmDecodingConfig &config,

Просмотреть файл

@ -200,6 +200,12 @@ struct OnlineGmmAdaptationState {
OnlineCmvnState cmvn_state;
FmllrDiagGmmAccs spk_stats;
Matrix<BaseFloat> transform;
// Writing and reading of the state of the object
void Write(std::ostream &out_stream, bool binary) const;
void Read(std::istream &in_stream, bool binary);
};
/**

Просмотреть файл

@ -116,6 +116,11 @@ class FmllrDiagGmmAccs: public AffineXformStats {
// Note: we allow copy and assignment for this class.
// Note: you can use the inherited AffineXformStats::Read
// and AffineXformStats::Write methods for writing/reading
// of the object. It is not necessary to store the other
// private variables of this class
private:
// The things below, added in 2013, relate to an optimization that lets us
// speed up accumulation if there are multiple active pdfs per frame