Classes | |
class | AddShift |
Adds shift to all the lines of the matrix (can be used for global mean normalization) More... | |
class | AffineTransform |
class | AveragePoolingComponent |
AveragePoolingComponent : The input/output matrices are split to submatrices with width 'pool_stride_'. More... | |
class | BlockSoftmax |
class | BlstmProjected |
class | Component |
Abstract class, building block of the network. More... | |
class | ConvolutionalComponent |
ConvolutionalComponent implements convolution over single axis (i.e. More... | |
class | CopyComponent |
Rearrange the matrix columns according to the indices in copy_from_indices_. More... | |
class | Dropout |
class | FramePoolingComponent |
FramePoolingComponent : The input/output matrices are split to frames of width 'feature_dim_'. More... | |
class | HiddenSoftmax |
class | KlHmm |
class | LengthNormComponent |
Rescale the matrix-rows to have unit length (L2-norm). More... | |
class | LinearTransform |
class | LossItf |
struct | LossOptions |
class | LstmProjected |
class | MatrixBuffer |
A buffer for caching (utterance-key, feature-matrix) pairs. More... | |
struct | MatrixBufferOptions |
class | MatrixRandomizer |
Shuffles rows of a matrix according to the indices in the mask,. More... | |
class | MaxPoolingComponent |
MaxPoolingComponent : The input/output matrices are split to submatrices with width 'pool_stride_'. More... | |
class | Mse |
class | MultiBasisComponent |
class | MultistreamComponent |
Class MultistreamComponent is an extension of UpdatableComponent for recurrent networks, which are trained with parallel sequences. More... | |
class | MultiTaskLoss |
class | Nnet |
struct | NnetDataRandomizerOptions |
Configuration variables that affect how frame-level shuffling is done. More... | |
struct | NnetTrainOptions |
class | ParallelComponent |
class | ParametricRelu |
class | PdfPrior |
struct | PdfPriorOptions |
class | RandomizerMask |
Generates randomly ordered vector of indices,. More... | |
class | Rbm |
class | RbmBase |
struct | RbmTrainOptions |
class | RecurrentComponent |
Component with recurrent connections, 'tanh' non-linearity. More... | |
class | Rescale |
Rescale the data column-wise by a vector (can be used for global variance normalization) More... | |
class | SentenceAveragingComponent |
Deprecated!!!, keeping it as Katka Zmolikova used it in JSALT 2015. More... | |
class | Sigmoid |
class | SimpleSentenceAveragingComponent |
SimpleSentenceAveragingComponent does not have nested network, it is intended to be used inside of a <ParallelComponent>. More... | |
class | Softmax |
class | Splice |
Splices the time context of the input features in N, out k*N, FrameOffset o_1,o_2,...,o_k FrameOffset example 11frames: -5 -4 -3 -2 -1 0 1 2 3 4 5. More... | |
class | StdVectorRandomizer |
Randomizes elements of a vector according to a mask. More... | |
class | Tanh |
class | UpdatableComponent |
Class UpdatableComponent is a Component which has trainable parameters, it contains SGD training hyper-parameters in NnetTrainOptions. More... | |
class | VectorRandomizer |
Randomizes elements of a vector according to a mask. More... | |
class | Xent |
Typedefs | |
typedef StdVectorRandomizer< int32 > | Int32VectorRandomizer |
typedef StdVectorRandomizer< std::vector< std::pair< int32, BaseFloat > > > | PosteriorRandomizer |
Functions | |
template<typename Real > | |
void | ReadCuMatrixFromString (const std::string &s, CuMatrix< Real > *m) |
Component * | ReadComponentFromString (const std::string &s) |
void | UnitTestLengthNorm () |
void | UnitTestSimpleSentenceAveragingComponent () |
void | UnitTestConvolutionalComponentUnity () |
void | UnitTestConvolutionalComponent3x3 () |
void | UnitTestMaxPoolingComponent () |
void | UnitTestDropoutComponent () |
template<typename T > | |
void | CountCorrectFramesWeighted (const CuArray< T > &hyp, const CuArray< T > &ref, const CuVectorBase< BaseFloat > &weights, Vector< double > *correct) |
Helper function of Xent::Eval, calculates number of matching elemente in 'hyp', 'ref' weighted by 'weights'. More... | |
template<typename T > | |
std::ostream & | operator<< (std::ostream &os, const std::vector< T > &v) |
Define stream insertion opeartor for 'std::vector', useful for log-prints,. More... | |
template<typename T > | |
std::string | ToString (const T &t) |
Convert basic type to a string (please don't overuse),. More... | |
template<typename Real > | |
std::string | MomentStatistics (const VectorBase< Real > &vec) |
Get a string with statistics of the data in a vector, so we can print them easily. More... | |
template<typename Real > | |
std::string | MomentStatistics (const MatrixBase< Real > &mat) |
Overload MomentStatistics to MatrixBase<Real> More... | |
template<typename Real > | |
std::string | MomentStatistics (const CuVectorBase< Real > &vec) |
Overload MomentStatistics to CuVectorBase<Real> More... | |
template<typename Real > | |
std::string | MomentStatistics (const CuMatrixBase< Real > &mat) |
Overload MomentStatistics to CuMatrix<Real> More... | |
template<typename Real > | |
void | CheckNanInf (const CuMatrixBase< Real > &mat, const char *msg="") |
Check that matrix contains no nan or inf. More... | |
template<typename Real > | |
Real | ComputeStdDev (const CuMatrixBase< Real > &mat) |
Get the standard deviation of values in the matrix. More... | |
template<typename Real > | |
void | RandGauss (BaseFloat mu, BaseFloat sigma, CuMatrixBase< Real > *mat, struct RandomState *state=NULL) |
Fill CuMatrix with random numbers (Gaussian distribution): mu = the mean value, sigma = standard deviation,. More... | |
template<typename Real > | |
void | RandUniform (BaseFloat mu, BaseFloat range, CuMatrixBase< Real > *mat, struct RandomState *state=NULL) |
Fill CuMatrix with random numbers (Uniform distribution): mu = the mean value, range = the 'width' of the uniform PDF (spanning mu-range/2 . More... | |
template<typename Real > | |
void | RandUniform (BaseFloat mu, BaseFloat range, CuVectorBase< Real > *vec, struct RandomState *state=NULL) |
Fill CuVector with random numbers (Uniform distribution): mu = the mean value, range = the 'width' of the uniform PDF (spanning mu-range/2 . More... | |
void | BuildIntegerVector (const std::vector< std::vector< int32 > > &in, std::vector< int32 > *out) |
Build 'integer vector' out of vector of 'matlab-like' representation: 'b, b:e, b:s:e'. More... | |
void | BuildIntegerVector (const std::vector< std::vector< int32 > > &in, CuArray< int32 > *out) |
Wrapper with 'CuArray<int32>' output. More... | |
template<typename Real > | |
void | PosteriorToMatrix (const Posterior &post, const int32 post_dim, CuMatrix< Real > *mat) |
Wrapper of PosteriorToMatrix with CuMatrix argument. More... | |
template<typename Real > | |
void | PosteriorToPdfMatrix (const Posterior &post, const TransitionModel &model, CuMatrix< Real > *mat) |
Wrapper of PosteriorToMatrixMapped with CuMatrix argument. More... | |
void | LatticeAcousticRescore (const Matrix< BaseFloat > &log_like, const TransitionModel &trans_model, const std::vector< int32 > &state_times, Lattice *lat) |
Definition at line 267 of file nnet-randomizer.h.
typedef StdVectorRandomizer<std::vector<std::pair<int32, BaseFloat> > > PosteriorRandomizer |
Definition at line 268 of file nnet-randomizer.h.
|
inline |
Build 'integer vector' out of vector of 'matlab-like' representation: 'b, b:e, b:s:e'.
b,e,s are integers, where: b = beginning e = end s = step
The sequence includes 'end', 1:3 => [ 1 2 3 ]. The 'step' has to be positive.
Definition at line 239 of file nnet-utils.h.
References rnnlm::i, rnnlm::j, KALDI_ASSERT, and KALDI_ERR.
Referenced by BuildIntegerVector(), Splice::InitData(), and CopyComponent::InitData().
|
inline |
Wrapper with 'CuArray<int32>' output.
Definition at line 280 of file nnet-utils.h.
References BuildIntegerVector().
void kaldi::nnet1::CheckNanInf | ( | const CuMatrixBase< Real > & | mat, |
const char * | msg = "" |
||
) |
Check that matrix contains no nan or inf.
Definition at line 132 of file nnet-utils.h.
References KALDI_ERR, KALDI_ISINF, KALDI_ISNAN, and CuMatrixBase< Real >::Sum().
Referenced by Rbm::RbmUpdate().
Real kaldi::nnet1::ComputeStdDev | ( | const CuMatrixBase< Real > & | mat | ) |
Get the standard deviation of values in the matrix.
Definition at line 142 of file nnet-utils.h.
References KALDI_WARN, CuMatrixBase< Real >::MulElements(), CuMatrixBase< Real >::NumCols(), CuMatrixBase< Real >::NumRows(), and CuMatrixBase< Real >::Sum().
Referenced by Rbm::RbmUpdate().
|
inline |
Helper function of Xent::Eval, calculates number of matching elemente in 'hyp', 'ref' weighted by 'weights'.
Definition at line 41 of file nnet-loss.cc.
References CuArrayBase< T >::CopyToVec(), CuVectorBase< Real >::CopyToVec(), CuArrayBase< T >::Dim(), VectorBase< Real >::Dim(), CuVectorBase< Real >::Dim(), rnnlm::i, and KALDI_ASSERT.
Referenced by Xent::Eval().
void LatticeAcousticRescore | ( | const Matrix< BaseFloat > & | log_like, |
const TransitionModel & | trans_model, | ||
const std::vector< int32 > & | state_times, | ||
Lattice * | lat | ||
) |
Definition at line 45 of file nnet-train-mmi-sequential.cc.
References rnnlm::i, KALDI_ASSERT, KALDI_ERR, MatrixBase< Real >::NumRows(), and TransitionModel::TransitionIdToPdf().
Referenced by main().
std::string kaldi::nnet1::MomentStatistics | ( | const VectorBase< Real > & | vec | ) |
Get a string with statistics of the data in a vector, so we can print them easily.
Definition at line 63 of file nnet-utils.h.
References VectorBase< Real >::Add(), VectorBase< Real >::Dim(), VectorBase< Real >::Max(), VectorBase< Real >::Min(), VectorBase< Real >::MulElements(), and VectorBase< Real >::Sum().
Referenced by ParametricRelu::Info(), LinearTransform::Info(), AffineTransform::Info(), RecurrentComponent::Info(), ConvolutionalComponent::Info(), LstmProjected::Info(), AddShift::Info(), BlstmProjected::Info(), Rescale::Info(), Nnet::InfoBackPropagate(), ParametricRelu::InfoGradient(), LinearTransform::InfoGradient(), AffineTransform::InfoGradient(), RecurrentComponent::InfoGradient(), ConvolutionalComponent::InfoGradient(), LstmProjected::InfoGradient(), AddShift::InfoGradient(), BlstmProjected::InfoGradient(), Rescale::InfoGradient(), Nnet::InfoPropagate(), and MomentStatistics().
std::string kaldi::nnet1::MomentStatistics | ( | const MatrixBase< Real > & | mat | ) |
Overload MomentStatistics to MatrixBase<Real>
Definition at line 102 of file nnet-utils.h.
References VectorBase< Real >::CopyRowsFromMat(), MomentStatistics(), MatrixBase< Real >::NumCols(), and MatrixBase< Real >::NumRows().
std::string kaldi::nnet1::MomentStatistics | ( | const CuVectorBase< Real > & | vec | ) |
Overload MomentStatistics to CuVectorBase<Real>
Definition at line 112 of file nnet-utils.h.
References CuVectorBase< Real >::CopyToVec(), CuVectorBase< Real >::Dim(), and MomentStatistics().
std::string kaldi::nnet1::MomentStatistics | ( | const CuMatrixBase< Real > & | mat | ) |
Overload MomentStatistics to CuMatrix<Real>
Definition at line 122 of file nnet-utils.h.
References CuMatrixBase< Real >::CopyToMat(), MomentStatistics(), CuMatrixBase< Real >::NumCols(), and CuMatrixBase< Real >::NumRows().
std::ostream& kaldi::nnet1::operator<< | ( | std::ostream & | os, |
const std::vector< T > & | v | ||
) |
Define stream insertion opeartor for 'std::vector', useful for log-prints,.
Definition at line 43 of file nnet-utils.h.
void kaldi::nnet1::PosteriorToMatrix | ( | const Posterior & | post, |
const int32 | post_dim, | ||
CuMatrix< Real > * | mat | ||
) |
Wrapper of PosteriorToMatrix with CuMatrix argument.
Definition at line 292 of file nnet-utils.h.
Referenced by Xent::Eval(), Mse::Eval(), and MultiTaskLoss::Eval().
void kaldi::nnet1::PosteriorToPdfMatrix | ( | const Posterior & | post, |
const TransitionModel & | model, | ||
CuMatrix< Real > * | mat | ||
) |
Wrapper of PosteriorToMatrixMapped with CuMatrix argument.
Definition at line 304 of file nnet-utils.h.
Referenced by main().
void kaldi::nnet1::RandGauss | ( | BaseFloat | mu, |
BaseFloat | sigma, | ||
CuMatrixBase< Real > * | mat, | ||
struct RandomState * | state = NULL |
||
) |
Fill CuMatrix with random numbers (Gaussian distribution): mu = the mean value, sigma = standard deviation,.
Using the CPU random generator.
Definition at line 164 of file nnet-utils.h.
References CuMatrixBase< Real >::CopyFromMat(), kaldi::kUndefined, CuMatrixBase< Real >::NumCols(), and CuMatrixBase< Real >::NumRows().
Referenced by AffineTransform::InitData(), LinearTransform::InitData(), ConvolutionalComponent::InitData(), Rbm::InitData(), and InitRand().
void kaldi::nnet1::RandUniform | ( | BaseFloat | mu, |
BaseFloat | range, | ||
CuMatrixBase< Real > * | mat, | ||
struct RandomState * | state = NULL |
||
) |
Fill CuMatrix with random numbers (Uniform distribution): mu = the mean value, range = the 'width' of the uniform PDF (spanning mu-range/2 .
. mu+range/2)
Using the CPU random generator.
Definition at line 188 of file nnet-utils.h.
References CuMatrixBase< Real >::CopyFromMat(), kaldi::kUndefined, CuMatrixBase< Real >::NumCols(), CuMatrixBase< Real >::NumRows(), and kaldi::Rand().
Referenced by AffineTransform::InitData(), RecurrentComponent::InitData(), LstmProjected::InitData(), BlstmProjected::InitData(), ConvolutionalComponent::InitData(), and Rbm::InitData().
void kaldi::nnet1::RandUniform | ( | BaseFloat | mu, |
BaseFloat | range, | ||
CuVectorBase< Real > * | vec, | ||
struct RandomState * | state = NULL |
||
) |
Fill CuVector with random numbers (Uniform distribution): mu = the mean value, range = the 'width' of the uniform PDF (spanning mu-range/2 .
. mu+range/2)
Using the CPU random generator.
Definition at line 212 of file nnet-utils.h.
References CuVectorBase< Real >::CopyFromVec(), CuVectorBase< Real >::Dim(), rnnlm::i, kaldi::kUndefined, and kaldi::Rand().
Component* kaldi::nnet1::ReadComponentFromString | ( | const std::string & | s | ) |
Definition at line 42 of file nnet-component-test.cc.
References Component::Read().
Referenced by UnitTestConvolutionalComponent3x3(), UnitTestConvolutionalComponentUnity(), UnitTestDropoutComponent(), UnitTestLengthNorm(), and UnitTestSimpleSentenceAveragingComponent().
void kaldi::nnet1::ReadCuMatrixFromString | ( | const std::string & | s, |
CuMatrix< Real > * | m | ||
) |
Definition at line 37 of file nnet-component-test.cc.
References CuMatrix< Real >::Read().
Referenced by UnitTestConvolutionalComponent3x3(), UnitTestConvolutionalComponentUnity(), UnitTestLengthNorm(), UnitTestMaxPoolingComponent(), and UnitTestSimpleSentenceAveragingComponent().
std::string kaldi::nnet1::ToString | ( | const T & | t | ) |
Convert basic type to a string (please don't overuse),.
Definition at line 52 of file nnet-utils.h.
Referenced by SimpleSentenceAveragingComponent::Info(), ParametricRelu::Info(), LinearTransform::Info(), AffineTransform::Info(), BlockSoftmax::Info(), CopyComponent::Info(), ConvolutionalComponent::Info(), LstmProjected::Info(), Dropout::Info(), AddShift::Info(), BlstmProjected::Info(), Rescale::Info(), ParametricRelu::InfoGradient(), LinearTransform::InfoGradient(), AffineTransform::InfoGradient(), RecurrentComponent::InfoGradient(), FramePoolingComponent::InfoGradient(), ConvolutionalComponent::InfoGradient(), LstmProjected::InfoGradient(), AddShift::InfoGradient(), BlstmProjected::InfoGradient(), Rescale::InfoGradient(), and main().
void kaldi::nnet1::UnitTestConvolutionalComponent3x3 | ( | ) |
Definition at line 131 of file nnet-component-test.cc.
References kaldi::AssertEqual(), Component::Backpropagate(), KALDI_LOG, Component::Propagate(), ReadComponentFromString(), and ReadCuMatrixFromString().
Referenced by main().
void kaldi::nnet1::UnitTestConvolutionalComponentUnity | ( | ) |
Definition at line 100 of file nnet-component-test.cc.
References kaldi::AssertEqual(), Component::Backpropagate(), KALDI_LOG, Component::Propagate(), ReadComponentFromString(), and ReadCuMatrixFromString().
Referenced by main().
void kaldi::nnet1::UnitTestDropoutComponent | ( | ) |
Definition at line 245 of file nnet-component-test.cc.
References kaldi::AssertEqual(), Component::Backpropagate(), Component::Propagate(), ReadComponentFromString(), CuMatrixBase< Real >::Set(), and CuMatrixBase< Real >::Sum().
Referenced by main().
void kaldi::nnet1::UnitTestLengthNorm | ( | ) |
Definition at line 51 of file nnet-component-test.cc.
References CuVectorBase< Real >::AddColSumMat(), CuVectorBase< Real >::ApplyPow(), kaldi::AssertEqual(), CuMatrixBase< Real >::MulElements(), Component::Propagate(), ReadComponentFromString(), ReadCuMatrixFromString(), and CuVectorBase< Real >::Set().
Referenced by main().
void kaldi::nnet1::UnitTestMaxPoolingComponent | ( | ) |
Definition at line 176 of file nnet-component-test.cc.
References kaldi::AssertEqual(), Component::Backpropagate(), Component::Init(), KALDI_LOG, Component::Propagate(), ReadCuMatrixFromString(), and CuMatrixBase< Real >::Set().
Referenced by main().
void kaldi::nnet1::UnitTestSimpleSentenceAveragingComponent | ( | ) |
Definition at line 70 of file nnet-component-test.cc.
References kaldi::AssertEqual(), Component::Backpropagate(), rnnlm::i, CuMatrixBase< Real >::NumRows(), Component::Propagate(), ReadComponentFromString(), ReadCuMatrixFromString(), CuMatrixBase< Real >::Row(), and CuVectorBase< Real >::Set().
Referenced by main().