#include <lvtln.h>
Public Member Functions | |
LinearVtln () | |
LinearVtln (int32 dim, int32 num_classes, int32 default_class) | |
void | SetTransform (int32 i, const MatrixBase< BaseFloat > &transform) |
void | SetWarp (int32 i, BaseFloat warp) |
BaseFloat | GetWarp (int32 i) const |
void | GetTransform (int32 i, MatrixBase< BaseFloat > *transform) const |
void | ComputeTransform (const FmllrDiagGmmAccs &accs, std::string norm_type, BaseFloat logdet_scale, MatrixBase< BaseFloat > *Ws, int32 *class_idx, BaseFloat *logdet_out, BaseFloat *objf_impr=NULL, BaseFloat *count=NULL) |
Compute the transform for the speaker. More... | |
void | Read (std::istream &is, bool binary) |
void | Write (std::ostream &os, bool binary) const |
int32 | Dim () const |
int32 | NumClasses () const |
void | GetOffset (const FmllrDiagGmmAccs &speaker_stats, int32 class_idx, VectorBase< BaseFloat > *offset) const |
Protected Attributes | |
int32 | default_class_ |
std::vector< Matrix< BaseFloat > > | A_ |
std::vector< BaseFloat > | logdets_ |
std::vector< BaseFloat > | warps_ |
Friends | |
class | LinearVtlnStats |
|
inline |
Definition at line 42 of file lvtln.h.
References LinearVtln::ComputeTransform(), count, LinearVtln::GetTransform(), LinearVtln::GetWarp(), rnnlm::i, LinearVtln::Read(), LinearVtln::SetTransform(), LinearVtln::SetWarp(), and LinearVtln::Write().
LinearVtln | ( | int32 | dim, |
int32 | num_classes, | ||
int32 | default_class | ||
) |
Definition at line 29 of file lvtln.cc.
References LinearVtln::A_, LinearVtln::default_class_, rnnlm::i, KALDI_ASSERT, LinearVtln::logdets_, and LinearVtln::warps_.
void ComputeTransform | ( | const FmllrDiagGmmAccs & | accs, |
std::string | norm_type, | ||
BaseFloat | logdet_scale, | ||
MatrixBase< BaseFloat > * | Ws, | ||
int32 * | class_idx, | ||
BaseFloat * | logdet_out, | ||
BaseFloat * | objf_impr = NULL , |
||
BaseFloat * | count = NULL |
||
) |
Compute the transform for the speaker.
Definition at line 97 of file lvtln.cc.
References LinearVtln::A_, kaldi::ApplyFeatureTransformToStats(), AffineXformStats::beta_, kaldi::ComposeTransforms(), kaldi::ComputeFmllrMatrixDiagGmm(), MatrixBase< Real >::CopyFromMat(), LinearVtln::default_class_, LinearVtln::Dim(), kaldi::FmllrAuxFuncDiagGmm(), rnnlm::i, KALDI_ASSERT, KALDI_ERR, KALDI_WARN, LinearVtln::logdets_, LinearVtln::NumClasses(), MatrixBase< Real >::NumCols(), MatrixBase< Real >::NumRows(), MatrixBase< Real >::Range(), and MatrixBase< Real >::SetUnit().
Referenced by LinearVtln::LinearVtln(), and main().
|
inline |
Definition at line 77 of file lvtln.h.
References LinearVtln::A_, and KALDI_ASSERT.
Referenced by LinearVtln::ComputeTransform(), LinearVtln::GetTransform(), main(), and LinearVtln::SetTransform().
void GetOffset | ( | const FmllrDiagGmmAccs & | speaker_stats, |
int32 | class_idx, | ||
VectorBase< BaseFloat > * | offset | ||
) | const |
Referenced by LinearVtln::NumClasses().
void GetTransform | ( | int32 | i, |
MatrixBase< BaseFloat > * | transform | ||
) | const |
Definition at line 185 of file lvtln.cc.
References LinearVtln::A_, MatrixBase< Real >::CopyFromMat(), LinearVtln::Dim(), KALDI_ASSERT, LinearVtln::NumClasses(), MatrixBase< Real >::NumCols(), and MatrixBase< Real >::NumRows().
Referenced by LinearVtln::LinearVtln().
Definition at line 180 of file lvtln.cc.
References rnnlm::i, KALDI_ASSERT, LinearVtln::NumClasses(), and LinearVtln::warps_.
Referenced by LinearVtln::LinearVtln(), and main().
|
inline |
Definition at line 78 of file lvtln.h.
References LinearVtln::A_, and LinearVtln::GetOffset().
Referenced by LinearVtln::ComputeTransform(), LinearVtln::GetTransform(), LinearVtln::GetWarp(), main(), LinearVtln::SetTransform(), and LinearVtln::SetWarp().
void Read | ( | std::istream & | is, |
bool | binary | ||
) |
Definition at line 45 of file lvtln.cc.
References LinearVtln::A_, LinearVtln::default_class_, kaldi::ExpectToken(), rnnlm::i, KALDI_ASSERT, LinearVtln::logdets_, kaldi::ReadBasicType(), kaldi::ReadToken(), and LinearVtln::warps_.
Referenced by LinearVtln::LinearVtln().
void SetTransform | ( | int32 | i, |
const MatrixBase< BaseFloat > & | transform | ||
) |
Definition at line 166 of file lvtln.cc.
References LinearVtln::A_, LinearVtln::Dim(), rnnlm::i, KALDI_ASSERT, LinearVtln::logdets_, LinearVtln::NumClasses(), MatrixBase< Real >::NumCols(), and MatrixBase< Real >::NumRows().
Referenced by LinearVtln::LinearVtln(), and main().
Definition at line 174 of file lvtln.cc.
References rnnlm::i, KALDI_ASSERT, LinearVtln::NumClasses(), and LinearVtln::warps_.
Referenced by LinearVtln::LinearVtln(), and main().
void Write | ( | std::ostream & | os, |
bool | binary | ||
) | const |
Definition at line 74 of file lvtln.cc.
References LinearVtln::A_, LinearVtln::default_class_, rnnlm::i, KALDI_ASSERT, LinearVtln::logdets_, LinearVtln::warps_, kaldi::WriteBasicType(), and kaldi::WriteToken().
Referenced by LinearVtln::LinearVtln(), and main().
Definition at line 88 of file lvtln.h.
Referenced by LinearVtln::ComputeTransform(), LinearVtln::Dim(), LinearVtln::GetTransform(), LinearVtln::LinearVtln(), LinearVtln::NumClasses(), LinearVtln::Read(), LinearVtln::SetTransform(), and LinearVtln::Write().
|
protected |
Definition at line 87 of file lvtln.h.
Referenced by LinearVtln::ComputeTransform(), LinearVtln::LinearVtln(), LinearVtln::Read(), and LinearVtln::Write().
|
protected |
Definition at line 89 of file lvtln.h.
Referenced by LinearVtln::ComputeTransform(), LinearVtln::LinearVtln(), LinearVtln::Read(), LinearVtln::SetTransform(), and LinearVtln::Write().
|
protected |
Definition at line 90 of file lvtln.h.
Referenced by LinearVtln::GetWarp(), LinearVtln::LinearVtln(), LinearVtln::Read(), LinearVtln::SetWarp(), and LinearVtln::Write().