#include <transform-common.h>
Public Member Functions | |
AffineXformStats () | |
void | Init (int32 dim, int32 num_gs) |
int32 | Dim () const |
void | SetZero () |
void | CopyStats (const AffineXformStats &other) |
void | Add (const AffineXformStats &other) |
void | Write (std::ostream &out, bool binary) const |
void | Read (std::istream &in, bool binary, bool add) |
AffineXformStats (const AffineXformStats &other) | |
Public Attributes | |
double | beta_ |
beta_ is the occupation count. More... | |
Matrix< double > | K_ |
K_ is the summed outer product of [mean times inverse variance] with [extended data], scaled by the occupation counts; dimension is dim by (dim+1) More... | |
std::vector< SpMatrix< double > > | G_ |
G_ is the outer product of extended-data, scaled by inverse variance, for each dimension. More... | |
int32 | dim_ |
dim_ is the feature dimension. More... | |
Definition at line 30 of file transform-common.h.
|
inline |
Definition at line 44 of file transform-common.h.
References AffineXformStats::Init().
|
inline |
Definition at line 52 of file transform-common.h.
References kaldi::ApplyAffineTransform(), and kaldi::ComposeTransforms().
void Add | ( | const AffineXformStats & | other | ) |
Definition at line 123 of file transform-common.cc.
References MatrixBase< Real >::AddMat(), AffineXformStats::beta_, AffineXformStats::dim_, AffineXformStats::G_, rnnlm::i, AffineXformStats::K_, KALDI_ASSERT, and kaldi::kNoTrans.
Referenced by AffineXformStats::Dim().
void CopyStats | ( | const AffineXformStats & | other | ) |
Definition at line 114 of file transform-common.cc.
References AffineXformStats::beta_, MatrixBase< Real >::CopyFromMat(), AffineXformStats::dim_, AffineXformStats::G_, rnnlm::i, AffineXformStats::K_, KALDI_ASSERT, and kaldi::kNoTrans.
Referenced by AffineXformStats::Dim().
|
inline |
Definition at line 46 of file transform-common.h.
References AffineXformStats::Add(), AffineXformStats::CopyStats(), AffineXformStats::dim_, AffineXformStats::Read(), AffineXformStats::SetZero(), and AffineXformStats::Write().
Referenced by kaldi::ApplyFeatureTransformToStats(), kaldi::ApplyModelTransformToStats(), FmllrDiagGmmAccs::CommitSingleFrameStats(), CompressedAffineXformStats::CopyFromAffineXformStats(), CompressedAffineXformStats::CopyToAffineXformStats(), FmllrDiagGmmAccs::DataHasChanged(), and SingleUtteranceGmmDecoder::EstimateFmllr().
Definition at line 28 of file transform-common.cc.
References AffineXformStats::beta_, AffineXformStats::dim_, AffineXformStats::G_, rnnlm::i, AffineXformStats::K_, KALDI_WARN, kaldi::kSetZero, and Matrix< Real >::Resize().
Referenced by AffineXformStats::AffineXformStats(), CompressedAffineXformStats::CopyToAffineXformStats(), and FmllrDiagGmmAccs::Init().
Definition at line 69 of file transform-common.cc.
References MatrixBase< Real >::AddMat(), AffineXformStats::beta_, MatrixBase< Real >::CopyFromMat(), SpMatrix< Real >::CopyFromSp(), AffineXformStats::dim_, kaldi::ExpectToken(), AffineXformStats::G_, rnnlm::i, AffineXformStats::K_, kaldi::kNoTrans, MatrixBase< Real >::NumCols(), MatrixBase< Real >::NumRows(), PackedMatrix< Real >::NumRows(), PackedMatrix< Real >::Read(), Matrix< Real >::Read(), kaldi::ReadBasicType(), SpMatrix< Real >::Resize(), and Matrix< Real >::Resize().
Referenced by AffineXformStats::Dim(), and FmllrDiagGmmAccs::Read().
void SetZero | ( | ) |
Definition at line 105 of file transform-common.cc.
References AffineXformStats::beta_, AffineXformStats::G_, AffineXformStats::K_, and MatrixBase< Real >::SetZero().
Referenced by AffineXformStats::Dim().
void Write | ( | std::ostream & | out, |
bool | binary | ||
) | const |
Definition at line 48 of file transform-common.cc.
References AffineXformStats::beta_, AffineXformStats::dim_, AffineXformStats::G_, AffineXformStats::K_, PackedMatrix< Real >::Write(), MatrixBase< Real >::Write(), kaldi::WriteBasicType(), and kaldi::WriteToken().
Referenced by AffineXformStats::Dim(), and OnlineGmmAdaptationState::Write().
double beta_ |
beta_ is the occupation count.
Definition at line 33 of file transform-common.h.
Referenced by BasisFmllrAccus::AccuGradientScatter(), AffineXformStats::Add(), kaldi::CalBasisFmllrStepSize(), kaldi::CalcFmllrStepSize(), FmllrDiagGmmAccs::CommitSingleFrameStats(), kaldi::ComputeFmllrMatrixDiagGmmDiagonal(), kaldi::ComputeFmllrMatrixDiagGmmFull(), LinearVtln::ComputeTransform(), BasisFmllrEstimate::ComputeTransform(), CompressedAffineXformStats::CopyFromAffineXformStats(), AffineXformStats::CopyStats(), CompressedAffineXformStats::CopyToAffineXformStats(), SingleUtteranceGmmDecoder::EstimateFmllr(), kaldi::FmllrAuxfGradient(), kaldi::FmllrAuxFuncDiagGmm(), FmllrDiagGmmAccs::FmllrDiagGmmAccs(), AffineXformStats::Init(), AffineXformStats::Read(), AffineXformStats::SetZero(), FmllrDiagGmmAccs::Update(), and AffineXformStats::Write().
int32 dim_ |
dim_ is the feature dimension.
Definition at line 43 of file transform-common.h.
Referenced by AffineXformStats::Add(), kaldi::CalBasisFmllrStepSize(), BasisFmllrEstimate::ComputeTransform(), AffineXformStats::CopyStats(), AffineXformStats::Dim(), AffineXformStats::Init(), AffineXformStats::Read(), and AffineXformStats::Write().
std::vector< SpMatrix<double> > G_ |
G_ is the outer product of extended-data, scaled by inverse variance, for each dimension.
These are the quadratic stats in fMLLR; in the diagonal-fMLLR case G will be indexed 0 to dim_ - 1, but in the full-fMLLR case it will be indexed 0 to ((dim)(dim+1))/2. Each G_[i] is of dimension dim+1 by dim+1.
Definition at line 41 of file transform-common.h.
Referenced by BasisFmllrAccus::AccuGradientScatter(), AffineXformStats::Add(), kaldi::ApplyFeatureTransformToStats(), kaldi::ApplyModelTransformToStats(), kaldi::CalcFmllrStepSize(), FmllrDiagGmmAccs::CommitSingleFrameStats(), kaldi::ComputeFmllrMatrixDiagGmmDiagonal(), kaldi::ComputeFmllrMatrixDiagGmmFull(), kaldi::ComputeFmllrMatrixDiagGmmOffset(), BasisFmllrEstimate::ComputeTransform(), CompressedAffineXformStats::CopyFromAffineXformStats(), AffineXformStats::CopyStats(), CompressedAffineXformStats::CopyToAffineXformStats(), kaldi::FmllrAuxfGradient(), kaldi::FmllrAuxFuncDiagGmm(), FmllrDiagGmmAccs::FmllrDiagGmmAccs(), AffineXformStats::Init(), kaldi::MllrAuxFunction(), AffineXformStats::Read(), AffineXformStats::SetZero(), and AffineXformStats::Write().
Matrix<double> K_ |
K_ is the summed outer product of [mean times inverse variance] with [extended data], scaled by the occupation counts; dimension is dim by (dim+1)
Definition at line 36 of file transform-common.h.
Referenced by BasisFmllrAccus::AccuGradientScatter(), AffineXformStats::Add(), kaldi::ApplyFeatureTransformToStats(), kaldi::ApplyModelTransformToStats(), kaldi::CalcFmllrStepSize(), FmllrDiagGmmAccs::CommitSingleFrameStats(), kaldi::ComputeFmllrMatrixDiagGmmDiagonal(), kaldi::ComputeFmllrMatrixDiagGmmFull(), kaldi::ComputeFmllrMatrixDiagGmmOffset(), BasisFmllrEstimate::ComputeTransform(), CompressedAffineXformStats::CopyFromAffineXformStats(), AffineXformStats::CopyStats(), CompressedAffineXformStats::CopyToAffineXformStats(), kaldi::FmllrAuxfGradient(), kaldi::FmllrAuxFuncDiagGmm(), FmllrDiagGmmAccs::FmllrDiagGmmAccs(), AffineXformStats::Init(), kaldi::MllrAuxFunction(), AffineXformStats::Read(), AffineXformStats::SetZero(), and AffineXformStats::Write().