OnlineCmvnState Struct Reference

Struct OnlineCmvnState stores the state of CMVN adaptation between utterances (but not the state of the computation within an utterance). More...

#include <online-feature.h>

Collaboration diagram for OnlineCmvnState:

Public Member Functions

 OnlineCmvnState ()
 OnlineCmvnState (const Matrix< double > &global_stats)
 OnlineCmvnState (const OnlineCmvnState &other)
void Write (std::ostream &os, bool binary) const
void Read (std::istream &is, bool binary)

Public Attributes

Matrix< double > speaker_cmvn_stats
Matrix< double > global_cmvn_stats
Matrix< double > frozen_state

Detailed Description

Struct OnlineCmvnState stores the state of CMVN adaptation between utterances (but not the state of the computation within an utterance).

It stores the global CMVN stats and the stats of the current speaker (if we have seen previous utterances for this speaker), and possibly will have a member "frozen_state": if the user has called the function Freeze() of class OnlineCmvn, to fix the CMVN so we can estimate fMLLR on top of the fixed value of cmvn. If nonempty, "frozen_state" will reflect how we were normalizing the mean and (if applicable) variance at the time when that function was called.

Definition at line 266 of file online-feature.h.

Constructor & Destructor Documentation

◆ OnlineCmvnState() [1/3]

OnlineCmvnState ( )

Definition at line 281 of file online-feature.h.

281 { }

◆ OnlineCmvnState() [2/3]

OnlineCmvnState ( const Matrix< double > &  global_stats)

Definition at line 283 of file online-feature.h.

283  :
284  global_cmvn_stats(global_stats) { }
Matrix< double > global_cmvn_stats

◆ OnlineCmvnState() [3/3]

OnlineCmvnState ( const OnlineCmvnState other)

Definition at line 211 of file

211  :
212  speaker_cmvn_stats(other.speaker_cmvn_stats),
213  global_cmvn_stats(other.global_cmvn_stats),
214  frozen_state(other.frozen_state) { }
Matrix< double > speaker_cmvn_stats
Matrix< double > frozen_state
Matrix< double > global_cmvn_stats

Member Function Documentation

◆ Read()

void Read ( std::istream &  is,
bool  binary 

Definition at line 227 of file

References kaldi::ExpectToken(), OnlineCmvnState::frozen_state, OnlineCmvnState::global_cmvn_stats, Matrix< Real >::Read(), and OnlineCmvnState::speaker_cmvn_stats.

Referenced by OnlineGmmAdaptationState::Read(), and OnlineIvectorExtractorAdaptationState::Read().

227  {
228  ExpectToken(is, binary, "<OnlineCmvnState>"); // magic string.
229  ExpectToken(is, binary, "<SpeakerCmvnStats>");
230  speaker_cmvn_stats.Read(is, binary);
231  ExpectToken(is, binary, "<GlobalCmvnStats>");
232  global_cmvn_stats.Read(is, binary);
233  ExpectToken(is, binary, "<FrozenState>");
234  frozen_state.Read(is, binary);
235  ExpectToken(is, binary, "</OnlineCmvnState>");
236 }
Matrix< double > speaker_cmvn_stats
Matrix< double > frozen_state
void Read(std::istream &in, bool binary, bool add=false)
read from stream.
void ExpectToken(std::istream &is, bool binary, const char *token)
ExpectToken tries to read in the given token, and throws an exception on failure. ...
Matrix< double > global_cmvn_stats

◆ Write()

void Write ( std::ostream &  os,
bool  binary 
) const

Definition at line 216 of file

References OnlineCmvnState::frozen_state, OnlineCmvnState::global_cmvn_stats, OnlineCmvnState::speaker_cmvn_stats, MatrixBase< Real >::Write(), and kaldi::WriteToken().

Referenced by OnlineGmmAdaptationState::Write(), and OnlineIvectorExtractorAdaptationState::Write().

216  {
217  WriteToken(os, binary, "<OnlineCmvnState>"); // magic string.
218  WriteToken(os, binary, "<SpeakerCmvnStats>");
219  speaker_cmvn_stats.Write(os, binary);
220  WriteToken(os, binary, "<GlobalCmvnStats>");
221  global_cmvn_stats.Write(os, binary);
222  WriteToken(os, binary, "<FrozenState>");
223  frozen_state.Write(os, binary);
224  WriteToken(os, binary, "</OnlineCmvnState>");
225 }
void Write(std::ostream &out, bool binary) const
write to stream.
Matrix< double > speaker_cmvn_stats
Matrix< double > frozen_state
void WriteToken(std::ostream &os, bool binary, const char *token)
The WriteToken functions are for writing nonempty sequences of non-space characters.
Matrix< double > global_cmvn_stats

Member Data Documentation

◆ frozen_state

◆ global_cmvn_stats

Matrix<double> global_cmvn_stats

◆ speaker_cmvn_stats

The documentation for this struct was generated from the following files: