Base class which provides matrix operations not involving resizing or allocation. More...
#include <kaldi-matrix.h>
Public Member Functions | |
MatrixIndexT | NumRows () const |
Returns number of rows (or zero for empty matrix). More... | |
MatrixIndexT | NumCols () const |
Returns number of columns (or zero for empty matrix). More... | |
MatrixIndexT | Stride () const |
Stride (distance in memory between each row). Will be >= NumCols. More... | |
size_t | SizeInBytes () const |
Returns size in bytes of the data held by the matrix. More... | |
const Real * | Data () const |
Gives pointer to raw data (const). More... | |
Real * | Data () |
Gives pointer to raw data (non-const). More... | |
Real * | RowData (MatrixIndexT i) |
Returns pointer to data for one row (non-const) More... | |
const Real * | RowData (MatrixIndexT i) const |
Returns pointer to data for one row (const) More... | |
Real & | operator() (MatrixIndexT r, MatrixIndexT c) |
Indexing operator, non-const (only checks sizes if compiled with -DKALDI_PARANOID) More... | |
Real & | Index (MatrixIndexT r, MatrixIndexT c) |
Indexing operator, provided for ease of debugging (gdb doesn't work with parenthesis operator). More... | |
const Real | operator() (MatrixIndexT r, MatrixIndexT c) const |
Indexing operator, const (only checks sizes if compiled with -DKALDI_PARANOID) More... | |
void | SetZero () |
Sets matrix to zero. More... | |
void | Set (Real) |
Sets all elements to a specific value. More... | |
void | SetUnit () |
Sets to zero, except ones along diagonal [for non-square matrices too]. More... | |
void | SetRandn () |
Sets to random values of a normal distribution. More... | |
void | SetRandUniform () |
Sets to numbers uniformly distributed on (0, 1) More... | |
template<typename OtherReal > | |
void | CopyFromMat (const MatrixBase< OtherReal > &M, MatrixTransposeType trans=kNoTrans) |
Copy given matrix. (no resize is done). More... | |
void | CopyFromMat (const CompressedMatrix &M) |
Copy from compressed matrix. More... | |
template<typename OtherReal > | |
void | CopyFromSp (const SpMatrix< OtherReal > &M) |
Copy given spmatrix. (no resize is done). More... | |
template<typename OtherReal > | |
void | CopyFromTp (const TpMatrix< OtherReal > &M, MatrixTransposeType trans=kNoTrans) |
Copy given tpmatrix. (no resize is done). More... | |
template<typename OtherReal > | |
void | CopyFromMat (const CuMatrixBase< OtherReal > &M, MatrixTransposeType trans=kNoTrans) |
Copy from CUDA matrix. Implemented in ../cudamatrix/cu-matrix.h. More... | |
void | CopyRowsFromVec (const VectorBase< Real > &v) |
This function has two modes of operation. More... | |
void | CopyRowsFromVec (const CuVectorBase< Real > &v) |
This version of CopyRowsFromVec is implemented in ../cudamatrix/cu-vector.cc. More... | |
template<typename OtherReal > | |
void | CopyRowsFromVec (const VectorBase< OtherReal > &v) |
void | CopyColsFromVec (const VectorBase< Real > &v) |
Copies vector into matrix, column-by-column. More... | |
void | CopyColFromVec (const VectorBase< Real > &v, const MatrixIndexT col) |
Copy vector into specific column of matrix. More... | |
void | CopyRowFromVec (const VectorBase< Real > &v, const MatrixIndexT row) |
Copy vector into specific row of matrix. More... | |
void | CopyDiagFromVec (const VectorBase< Real > &v) |
Copy vector into diagonal of matrix. More... | |
const SubVector< Real > | Row (MatrixIndexT i) const |
Return specific row of matrix [const]. More... | |
SubVector< Real > | Row (MatrixIndexT i) |
Return specific row of matrix. More... | |
SubMatrix< Real > | Range (const MatrixIndexT row_offset, const MatrixIndexT num_rows, const MatrixIndexT col_offset, const MatrixIndexT num_cols) const |
Return a sub-part of matrix. More... | |
SubMatrix< Real > | RowRange (const MatrixIndexT row_offset, const MatrixIndexT num_rows) const |
SubMatrix< Real > | ColRange (const MatrixIndexT col_offset, const MatrixIndexT num_cols) const |
Real | Sum () const |
Returns sum of all elements in matrix. More... | |
Real | Trace (bool check_square=true) const |
Returns trace of matrix. More... | |
Real | Max () const |
Returns maximum element of matrix. More... | |
Real | Min () const |
Returns minimum element of matrix. More... | |
void | MulElements (const MatrixBase< Real > &A) |
Element by element multiplication with a given matrix. More... | |
void | DivElements (const MatrixBase< Real > &A) |
Divide each element by the corresponding element of a given matrix. More... | |
void | Scale (Real alpha) |
Multiply each element with a scalar value. More... | |
void | Max (const MatrixBase< Real > &A) |
Set, element-by-element, *this = max(*this, A) More... | |
void | Min (const MatrixBase< Real > &A) |
Set, element-by-element, *this = min(*this, A) More... | |
void | MulColsVec (const VectorBase< Real > &scale) |
Equivalent to (*this) = (*this) * diag(scale). More... | |
void | MulRowsVec (const VectorBase< Real > &scale) |
Equivalent to (*this) = diag(scale) * (*this). More... | |
void | MulRowsGroupMat (const MatrixBase< Real > &src) |
Divide each row into src.NumCols() equal groups, and then scale i'th row's j'th group of elements by src(i, j). More... | |
Real | LogDet (Real *det_sign=NULL) const |
Returns logdet of matrix. More... | |
void | Invert (Real *log_det=NULL, Real *det_sign=NULL, bool inverse_needed=true) |
matrix inverse. More... | |
void | InvertDouble (Real *LogDet=NULL, Real *det_sign=NULL, bool inverse_needed=true) |
matrix inverse [double]. More... | |
void | InvertElements () |
Inverts all the elements of the matrix. More... | |
void | Transpose () |
Transpose the matrix. More... | |
void | CopyCols (const MatrixBase< Real > &src, const MatrixIndexT *indices) |
Copies column r from column indices[r] of src. More... | |
void | CopyRows (const MatrixBase< Real > &src, const MatrixIndexT *indices) |
Copies row r from row indices[r] of src (does nothing As a special case, if indexes[i] == -1, sets row i to zero. More... | |
void | AddCols (const MatrixBase< Real > &src, const MatrixIndexT *indices) |
Add column indices[r] of src to column r. More... | |
void | CopyRows (const Real *const *src) |
Copies row r of this matrix from an array of floats at the location given by src[r]. More... | |
void | CopyToRows (Real *const *dst) const |
Copies row r of this matrix to the array of floats at the location given by dst[r]. More... | |
void | AddRows (Real alpha, const MatrixBase< Real > &src, const MatrixIndexT *indexes) |
Does for each row r, this.Row(r) += alpha * src.row(indexes[r]). More... | |
void | AddRows (Real alpha, const Real *const *src) |
Does for each row r, this.Row(r) += alpha * src[r], treating src[r] as the beginning of a region of memory representing a vector of floats, of the same length as this.NumCols(). More... | |
void | AddToRows (Real alpha, Real *const *dst) const |
For each row r of this matrix, adds it (times alpha) to the array of floats at the location given by dst[r]. More... | |
void | AddToRows (Real alpha, const MatrixIndexT *indexes, MatrixBase< Real > *dst) const |
For each row i of *this, adds this->Row(i) to dst->Row(indexes(i)) if indexes(i) >= 0, else do nothing. More... | |
void | ApplyPow (Real power) |
void | ApplyPowAbs (Real power, bool include_sign=false) |
void | ApplyHeaviside () |
void | ApplyFloor (Real floor_val) |
void | ApplyCeiling (Real ceiling_val) |
void | ApplyExp () |
void | ApplyExpSpecial () |
void | ApplyExpLimited (Real lower_limit, Real upper_limit) |
void | ApplyLog () |
void | Eig (MatrixBase< Real > *P, VectorBase< Real > *eigs_real, VectorBase< Real > *eigs_imag) const |
Eigenvalue Decomposition of a square NxN matrix into the form (*this) = P D P^{-1}. More... | |
bool | Power (Real pow) |
The Power method attempts to take the matrix to a power using a method that works in general for fractional and negative powers. More... | |
void | DestructiveSvd (VectorBase< Real > *s, MatrixBase< Real > *U, MatrixBase< Real > *Vt) |
Singular value decomposition Major limitations: For nonsquare matrices, we assume m>=n (NumRows >= NumCols), and we return the "skinny" Svd, i.e. More... | |
void | Svd (VectorBase< Real > *s, MatrixBase< Real > *U, MatrixBase< Real > *Vt) const |
Compute SVD (*this) = U diag(s) Vt. More... | |
void | Svd (VectorBase< Real > *s) const |
Compute SVD but only retain the singular values. More... | |
Real | MinSingularValue () const |
Returns smallest singular value. More... | |
void | TestUninitialized () const |
Real | Cond () const |
Returns condition number by computing Svd. More... | |
bool | IsSymmetric (Real cutoff=1.0e-05) const |
Returns true if matrix is Symmetric. More... | |
bool | IsDiagonal (Real cutoff=1.0e-05) const |
Returns true if matrix is Diagonal. More... | |
bool | IsUnit (Real cutoff=1.0e-05) const |
Returns true if the matrix is all zeros, except for ones on diagonal. More... | |
bool | IsZero (Real cutoff=1.0e-05) const |
Returns true if matrix is all zeros. More... | |
Real | FrobeniusNorm () const |
Frobenius norm, which is the sqrt of sum of square elements. More... | |
bool | ApproxEqual (const MatrixBase< Real > &other, float tol=0.01) const |
Returns true if ((*this)-other).FrobeniusNorm() <= tol * (*this).FrobeniusNorm(). More... | |
bool | Equal (const MatrixBase< Real > &other) const |
Tests for exact equality. It's usually preferable to use ApproxEqual. More... | |
Real | LargestAbsElem () const |
largest absolute value. More... | |
Real | LogSumExp (Real prune=-1.0) const |
Returns log(sum(exp())) without exp overflow If prune > 0.0, it uses a pruning beam, discarding terms less than (max - prune). More... | |
Real | ApplySoftMax () |
Apply soft-max to the collection of all elements of the matrix and return normalizer (log sum of exponentials). More... | |
void | Sigmoid (const MatrixBase< Real > &src) |
Set each element to the sigmoid of the corresponding element of "src". More... | |
void | Heaviside (const MatrixBase< Real > &src) |
Sets each element to the Heaviside step function (x > 0 ? 1 : 0) of the corresponding element in "src". More... | |
void | Exp (const MatrixBase< Real > &src) |
void | Pow (const MatrixBase< Real > &src, Real power) |
void | Log (const MatrixBase< Real > &src) |
void | PowAbs (const MatrixBase< Real > &src, Real power, bool include_sign=false) |
Apply power to the absolute value of each element. More... | |
void | Floor (const MatrixBase< Real > &src, Real floor_val) |
void | Ceiling (const MatrixBase< Real > &src, Real ceiling_val) |
void | ExpSpecial (const MatrixBase< Real > &src) |
For each element x of the matrix, set it to (x < 0 ? exp(x) : x + 1). More... | |
void | ExpLimited (const MatrixBase< Real > &src, Real lower_limit, Real upper_limit) |
This is equivalent to running: Floor(src, lower_limit); Ceiling(src, upper_limit); Exp(src) More... | |
void | SoftHinge (const MatrixBase< Real > &src) |
Set each element to y = log(1 + exp(x)) More... | |
void | GroupPnorm (const MatrixBase< Real > &src, Real power) |
Apply the function y(i) = (sum_{j = i*G}^{(i+1)*G-1} x_j^(power))^(1 / p). More... | |
void | GroupPnormDeriv (const MatrixBase< Real > &input, const MatrixBase< Real > &output, Real power) |
Calculate derivatives for the GroupPnorm function above... More... | |
void | GroupMax (const MatrixBase< Real > &src) |
Apply the function y(i) = (max_{j = i*G}^{(i+1)*G-1} x_j Requires src.NumRows() == this->NumRows() and src.NumCols() % this->NumCols() == 0. More... | |
void | GroupMaxDeriv (const MatrixBase< Real > &input, const MatrixBase< Real > &output) |
Calculate derivatives for the GroupMax function above, where "input" is the input to the GroupMax function above (i.e. More... | |
void | Tanh (const MatrixBase< Real > &src) |
Set each element to the tanh of the corresponding element of "src". More... | |
void | DiffSigmoid (const MatrixBase< Real > &value, const MatrixBase< Real > &diff) |
void | DiffTanh (const MatrixBase< Real > &value, const MatrixBase< Real > &diff) |
void | SymPosSemiDefEig (VectorBase< Real > *s, MatrixBase< Real > *P, Real check_thresh=0.001) |
Uses Svd to compute the eigenvalue decomposition of a symmetric positive semi-definite matrix: (*this) = rP * diag(rS) * rP^T, with rP an orthogonal matrix so rP^{-1} = rP^T. More... | |
void | Add (const Real alpha) |
Add a scalar to each element. More... | |
void | AddToDiag (const Real alpha) |
Add a scalar to each diagonal element. More... | |
template<typename OtherReal > | |
void | AddVecVec (const Real alpha, const VectorBase< OtherReal > &a, const VectorBase< OtherReal > &b) |
*this += alpha * a * b^T More... | |
template<typename OtherReal > | |
void | AddVecToRows (const Real alpha, const VectorBase< OtherReal > &v) |
[each row of *this] += alpha * v More... | |
template<typename OtherReal > | |
void | AddVecToCols (const Real alpha, const VectorBase< OtherReal > &v) |
[each col of *this] += alpha * v More... | |
void | AddMat (const Real alpha, const MatrixBase< Real > &M, MatrixTransposeType transA=kNoTrans) |
*this += alpha * M [or M^T] More... | |
void | AddSmat (Real alpha, const SparseMatrix< Real > &A, MatrixTransposeType trans=kNoTrans) |
*this += alpha * A [or A^T]. More... | |
void | AddSmatMat (Real alpha, const SparseMatrix< Real > &A, MatrixTransposeType transA, const MatrixBase< Real > &B, Real beta) |
(*this) = alpha * op(A) * B + beta * (*this), where A is sparse. More... | |
void | AddMatSmat (Real alpha, const MatrixBase< Real > &A, const SparseMatrix< Real > &B, MatrixTransposeType transB, Real beta) |
(*this) = alpha * A * op(B) + beta * (*this), where B is sparse and op(B) is either B or trans(B) depending on the 'transB' argument. More... | |
void | SymAddMat2 (const Real alpha, const MatrixBase< Real > &M, MatrixTransposeType transA, Real beta) |
*this = beta * *this + alpha * M M^T, for symmetric matrices. More... | |
void | AddDiagVecMat (const Real alpha, const VectorBase< Real > &v, const MatrixBase< Real > &M, MatrixTransposeType transM, Real beta=1.0) |
*this = beta * *this + alpha * diag(v) * M [or M^T]. More... | |
void | AddMatDiagVec (const Real alpha, const MatrixBase< Real > &M, MatrixTransposeType transM, VectorBase< Real > &v, Real beta=1.0) |
*this = beta * *this + alpha * M [or M^T] * diag(v) The same as adding M but scaling each column M_j by v(j). More... | |
void | AddMatMatElements (const Real alpha, const MatrixBase< Real > &A, const MatrixBase< Real > &B, const Real beta) |
*this = beta * *this + alpha * A .* B (.* element by element multiplication) More... | |
template<typename OtherReal > | |
void | AddSp (const Real alpha, const SpMatrix< OtherReal > &S) |
*this += alpha * S More... | |
void | AddMatMat (const Real alpha, const MatrixBase< Real > &A, MatrixTransposeType transA, const MatrixBase< Real > &B, MatrixTransposeType transB, const Real beta) |
void | SetMatMatDivMat (const MatrixBase< Real > &A, const MatrixBase< Real > &B, const MatrixBase< Real > &C) |
*this = a * b / c (by element; when c = 0, *this = a) More... | |
void | AddMatSmat (const Real alpha, const MatrixBase< Real > &A, MatrixTransposeType transA, const MatrixBase< Real > &B, MatrixTransposeType transB, const Real beta) |
A version of AddMatMat specialized for when the second argument contains a lot of zeroes. More... | |
void | AddSmatMat (const Real alpha, const MatrixBase< Real > &A, MatrixTransposeType transA, const MatrixBase< Real > &B, MatrixTransposeType transB, const Real beta) |
A version of AddMatMat specialized for when the first argument contains a lot of zeroes. More... | |
void | AddMatMatMat (const Real alpha, const MatrixBase< Real > &A, MatrixTransposeType transA, const MatrixBase< Real > &B, MatrixTransposeType transB, const MatrixBase< Real > &C, MatrixTransposeType transC, const Real beta) |
this <– beta*this + alpha*A*B*C. More... | |
void | AddSpMat (const Real alpha, const SpMatrix< Real > &A, const MatrixBase< Real > &B, MatrixTransposeType transB, const Real beta) |
this <– beta*this + alpha*SpA*B. More... | |
void | AddTpMat (const Real alpha, const TpMatrix< Real > &A, MatrixTransposeType transA, const MatrixBase< Real > &B, MatrixTransposeType transB, const Real beta) |
this <– beta*this + alpha*A*B. More... | |
void | AddMatSp (const Real alpha, const MatrixBase< Real > &A, MatrixTransposeType transA, const SpMatrix< Real > &B, const Real beta) |
this <– beta*this + alpha*A*B. More... | |
void | AddSpMatSp (const Real alpha, const SpMatrix< Real > &A, const MatrixBase< Real > &B, MatrixTransposeType transB, const SpMatrix< Real > &C, const Real beta) |
this <– beta*this + alpha*A*B*C. More... | |
void | AddMatTp (const Real alpha, const MatrixBase< Real > &A, MatrixTransposeType transA, const TpMatrix< Real > &B, MatrixTransposeType transB, const Real beta) |
this <– beta*this + alpha*A*B. More... | |
void | AddTpTp (const Real alpha, const TpMatrix< Real > &A, MatrixTransposeType transA, const TpMatrix< Real > &B, MatrixTransposeType transB, const Real beta) |
this <– beta*this + alpha*A*B. More... | |
void | AddSpSp (const Real alpha, const SpMatrix< Real > &A, const SpMatrix< Real > &B, const Real beta) |
this <– beta*this + alpha*A*B. More... | |
void | CopyLowerToUpper () |
Copy lower triangle to upper triangle (symmetrize) More... | |
void | CopyUpperToLower () |
Copy upper triangle to lower triangle (symmetrize) More... | |
void | OrthogonalizeRows () |
This function orthogonalizes the rows of a matrix using the Gram-Schmidt process. More... | |
void | Read (std::istream &in, bool binary, bool add=false) |
stream read. More... | |
void | Write (std::ostream &out, bool binary) const |
write to stream. More... | |
void | LapackGesvd (VectorBase< Real > *s, MatrixBase< Real > *U, MatrixBase< Real > *Vt) |
template<> | |
void | AddVecVec (const float alpha, const VectorBase< float > &ra, const VectorBase< float > &rb) |
template<> | |
void | AddVecVec (const double alpha, const VectorBase< double > &ra, const VectorBase< double > &rb) |
template<> | |
void | AddVecVec (const float alpha, const VectorBase< float > &a, const VectorBase< float > &rb) |
template<> | |
void | AddVecVec (const double alpha, const VectorBase< double > &a, const VectorBase< double > &rb) |
template<> | |
void | CopyFromSp (const SpMatrix< float > &M) |
template<> | |
void | CopyFromSp (const SpMatrix< double > &M) |
Protected Member Functions | |
MatrixBase (Real *data, MatrixIndexT cols, MatrixIndexT rows, MatrixIndexT stride) | |
Initializer, callable only from child. More... | |
MatrixBase () | |
Initializer, callable only from child. More... | |
~MatrixBase () | |
Real * | Data_workaround () const |
A workaround that allows SubMatrix to get a pointer to non-const data for const Matrix. More... | |
Protected Attributes | |
Real * | data_ |
data memory area More... | |
MatrixIndexT | num_cols_ |
these attributes store the real matrix size as it is stored in memory including memalignment More... | |
MatrixIndexT | num_rows_ |
< Number of columns More... | |
MatrixIndexT | stride_ |
< Number of rows More... | |
Private Member Functions | |
KALDI_DISALLOW_COPY_AND_ASSIGN (MatrixBase) | |
Friends | |
class | Matrix< Real > |
class | CuMatrixBase< Real > |
class | CuMatrix< Real > |
class | CuSubMatrix< Real > |
class | CuPackedMatrix< Real > |
class | PackedMatrix< Real > |
class | SparseMatrix< Real > |
class | SparseMatrix< float > |
class | SparseMatrix< double > |
class | SubMatrix< Real > |
Real | kaldi::TraceMatMat (const MatrixBase< Real > &A, const MatrixBase< Real > &B, MatrixTransposeType trans) |
Base class which provides matrix operations not involving resizing or allocation.
Classes Matrix and SubMatrix inherit from it and take care of allocation and resizing.
Definition at line 49 of file kaldi-matrix.h.
|
inlineexplicitprotected |
Initializer, callable only from child.
Definition at line 784 of file kaldi-matrix.h.
|
inlineexplicitprotected |
Initializer, callable only from child.
Empty initializer, for un-initialized matrix.
Definition at line 791 of file kaldi-matrix.h.
|
inlineprotected |
Definition at line 796 of file kaldi-matrix.h.
void Add | ( | const Real | alpha | ) |
Add a scalar to each element.
Definition at line 1677 of file kaldi-matrix.cc.
Referenced by AmSgmm2::ComponentPosteriors(), AmSgmm2::LogLikelihood(), kaldi::UnitTestApplyExpSpecial(), kaldi::UnitTestCompressedMatrix(), kaldi::UnitTestCuMatrixAdd(), kaldi::UnitTestCuMatrixAdd2(), kaldi::UnitTestCuMatrixApplyLog(), kaldi::UnitTestCuMatrixDivElements(), kaldi::UnitTestGeneralMatrix(), kaldi::UnitTestSetRandUniform(), and kaldi::UnitTestSimpleForMat().
void AddCols | ( | const MatrixBase< Real > & | src, |
const MatrixIndexT * | indices | ||
) |
Add column indices[r] of src to column r.
As a special case, if indexes[i] == -1, skip column i indices.size() must equal this->NumCols(), all elements of "reorder" must be in [-1, src.NumCols()-1], and src.NumRows() must equal this.NumRows()
Definition at line 2852 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ColRange().
void AddDiagVecMat | ( | const Real | alpha, |
const VectorBase< Real > & | v, | ||
const MatrixBase< Real > & | M, | ||
MatrixTransposeType | transM, | ||
Real | beta = 1.0 |
||
) |
*this = beta * *this + alpha * diag(v) * M [or M^T].
The same as adding M but scaling each row M_i by v(i).
Definition at line 576 of file kaldi-matrix.cc.
Referenced by kaldi::ComputeNormalizingTransform(), kaldi::UnitTestCuDiffNormalizePerRow(), and kaldi::UnitTestCuDiffSoftmax().
void AddMat | ( | const Real | alpha, |
const MatrixBase< Real > & | M, | ||
MatrixTransposeType | transA = kNoTrans |
||
) |
*this += alpha * M [or M^T]
Definition at line 356 of file kaldi-matrix.cc.
Referenced by Fmpe::AccStats(), BasisFmllrAccus::AccuGradientScatter(), AffineXformStats::Add(), AccumDiagGmm::Add(), IvectorExtractorStats::Add(), CuMatrixBase< float >::AddMatBlocks(), GeneralMatrix::AddToMat(), MatrixBase< float >::ApproxEqual(), kaldi::CalBasisFmllrStepSize(), kaldi::CalcFmllrStepSize(), MleAmSgmm2Updater::ComputeMPrior(), MleAmSgmm2Updater::ComputeSMeans(), BasisFmllrEstimate::ComputeTransform(), kaldi::FmllrAuxfGradient(), FmllrSgmm2Accs::FmllrObjGradient(), LogisticRegression::GetObjfAndGrad(), IvectorExtractorStats::GetOrthogonalIvectorTransform(), MleAmSgmm2Updater::MapUpdateM(), DiagGmm::Perturb(), AffineXformStats::Read(), AccumFullGmm::Read(), LdaEstimate::Read(), OnlineCmvn::SmoothOnlineCmvnStats(), AccumDiagGmm::SmoothWithModel(), kaldi::SolveQuadraticMatrixProblem(), MatrixBase< float >::SymPosSemiDefEig(), test_io(), kaldi::TestFmpe(), kaldi::TypeOneUsage(), kaldi::TypeOneUsageAverage(), kaldi::TypeThreeUsage(), kaldi::UnitTestAddMatDiagVec(), kaldi::UnitTestAddMatMatElements(), kaldi::UnitTestAddMatSelf(), kaldi::UnitTestAddOuterProductPlusMinus(), kaldi::UnitTestAxpy(), kaldi::UnitTestCompressedMatrix(), kaldi::UnitTestCuDiffLogSoftmax(), kaldi::UnitTestCuMatrixAddMat(), kaldi::UnitTestDeterminant(), kaldi::UnitTestGeneralMatrix(), kaldi::UnitTestSparseMatrixAddToMat(), FmllrSgmm2Accs::Update(), EbwAmSgmm2Updater::UpdateM(), EbwAmSgmm2Updater::UpdateN(), IvectorExtractorStats::UpdateVariances(), MleAmSgmm2Updater::UpdateW(), and MleAmSgmm2Updater::UpdateWGetStats().
void AddMatDiagVec | ( | const Real | alpha, |
const MatrixBase< Real > & | M, | ||
MatrixTransposeType | transM, | ||
VectorBase< Real > & | v, | ||
Real | beta = 1.0 |
||
) |
*this = beta * *this + alpha * M [or M^T] * diag(v) The same as adding M but scaling each column M_j by v(j).
Definition at line 601 of file kaldi-matrix.cc.
void AddMatMat | ( | const Real | alpha, |
const MatrixBase< Real > & | A, | ||
MatrixTransposeType | transA, | ||
const MatrixBase< Real > & | B, | ||
MatrixTransposeType | transB, | ||
const Real | beta | ||
) |
Definition at line 171 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::AddMatMatMat(), MatrixBase< float >::AddMatSp(), MatrixBase< float >::AddMatTp(), MatrixBase< float >::AddSpMat(), MatrixBase< float >::AddTpMat(), MatrixBase< float >::AddTpTp(), kaldi::ApplyFeatureTransformToStats(), kaldi::ApplyInvPreXformToChange(), kaldi::ApplyPca(), kaldi::ApplyPreXformToGradient(), Sgmm2Project::ApplyProjection(), Fmpe::ApplyProjection(), Plda::ApplyTransform(), kaldi::CalBasisFmllrStepSize(), kaldi::CalcFmllrStepSize(), kaldi::CholeskyUnitTestTr(), kaldi::ComposeTransforms(), kaldi::ComputeFeatureNormalizingTransform(), AmSgmm2::ComputeFmllrPreXform(), kaldi::ComputeLdaTransform(), AmSgmm2::ComputeNormalizersInternal(), kaldi::ComputePca(), MleAmSgmm2Updater::ComputeSMeans(), LogisticRegression::DoStep(), LdaEstimate::Estimate(), FeatureTransformEstimate::EstimateInternal(), FeatureTransformEstimateMulti::EstimateTransformPart(), IvectorExtractorStats::FlushCache(), kaldi::generate_features(), OnlineTransform::GetFrames(), LogisticRegression::GetLogPosteriors(), PldaEstimator::GetOutput(), DiagGmm::LogLikelihoods(), main(), kaldi::nnet3::PerturbImage(), MatrixBase< float >::Power(), OnlinePreconditionerSimple::PreconditionDirectionsCpu(), OnlineNaturalGradientSimple::PreconditionDirectionsCpu(), kaldi::nnet3::ReduceRankOfComponents(), MleAmSgmm2Updater::RenormalizeN(), MleAmSgmm2Updater::RenormalizeV(), kaldi::SlowMatMul(), kaldi::SolveDoubleQuadraticMatrixProblem(), kaldi::SolveQuadraticMatrixProblem(), kaldi::TestOnlineLdaInput(), TestSgmm2PreXform(), SpMatrix< float >::TopEigs(), kaldi::TraceMatMatMat(), kaldi::TraceMatMatMatMat(), kaldi::TraceMatSpMat(), IvectorExtractor::TransformIvectors(), OnlineLdaInput::TransformToOutput(), kaldi::UnitInvert(), kaldi::UnitTestAddDiagMat2(), kaldi::UnitTestAddDiagMatMat(), kaldi::UnitTestAddMat2Sp(), kaldi::UnitTestAddMatMatNans(), kaldi::UnitTestAddMatMatSpeed(), kaldi::UnitTestCholesky(), kaldi::UnitTestCuMatrixAddMatMat(), kaldi::UnitTestDct(), kaldi::UnitTestDeterminant(), kaldi::UnitTestDeterminantSign(), kaldi::UnitTestEig(), kaldi::UnitTestEigSymmetric(), UnitTestEstimateFullGmm(), kaldi::UnitTestInverse(), kaldi::UnitTestInvert(), kaldi::UnitTestLimitCondInvert(), kaldi::UnitTestMatrixAddMatSmat(), kaldi::UnitTestMatrixAddSmatMat(), kaldi::UnitTestMmul(), kaldi::UnitTestNonsymmetricPower(), kaldi::UnitTestOrthogonalizeRows(), kaldi::UnitTestPca(), kaldi::UnitTestPldaEstimation(), kaldi::UnitTestPower(), kaldi::UnitTestRankNUpdate(), kaldi::UnitTestSpInvert(), kaldi::UnitTestSvdNodestroy(), kaldi::UnitTestSymAddMat2(), kaldi::UnitTestTopEigs(), kaldi::UnitTestTpInvert(), kaldi::UnitTestTrace(), kaldi::UnitTestTrain(), kaldi::UnitTestTransposeScatter(), PldaUnsupervisedAdaptor::UpdatePlda(), IvectorExtractorStats::UpdatePrior(), IvectorExtractorStats::UpdateVariances(), MleAmSgmm2Updater::UpdateW(), and MleAmSgmm2Updater::UpdateWGetStats().
void AddMatMatElements | ( | const Real | alpha, |
const MatrixBase< Real > & | A, | ||
const MatrixBase< Real > & | B, | ||
const Real | beta | ||
) |
*this = beta * *this + alpha * A .* B (.* element by element multiplication)
Definition at line 636 of file kaldi-matrix.cc.
void AddMatMatMat | ( | const Real | alpha, |
const MatrixBase< Real > & | A, | ||
MatrixTransposeType | transA, | ||
const MatrixBase< Real > & | B, | ||
MatrixTransposeType | transB, | ||
const MatrixBase< Real > & | C, | ||
MatrixTransposeType | transC, | ||
const Real | beta | ||
) |
this <– beta*this + alpha*A*B*C.
Definition at line 1741 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::AddSpMatSp(), kaldi::nnet3::PerturbImage(), UnitTestEstimateLda(), kaldi::UnitTestSvd(), and kaldi::UnitTestTrace().
void AddMatSmat | ( | Real | alpha, |
const MatrixBase< Real > & | A, | ||
const SparseMatrix< Real > & | B, | ||
MatrixTransposeType | transB, | ||
Real | beta | ||
) |
(*this) = alpha * A * op(B) + beta * (*this), where B is sparse and op(B) is either B or trans(B) depending on the 'transB' argument.
This is multiplication of a dense by a sparse matrix. See also AddSmatMat.
Definition at line 491 of file kaldi-matrix.cc.
Referenced by kaldi::UnitTestMatrixAddMatSmat(), and kaldi::UnitTextCuMatrixAddMatSmat().
void AddMatSmat | ( | const Real | alpha, |
const MatrixBase< Real > & | A, | ||
MatrixTransposeType | transA, | ||
const MatrixBase< Real > & | B, | ||
MatrixTransposeType | transB, | ||
const Real | beta | ||
) |
A version of AddMatMat specialized for when the second argument contains a lot of zeroes.
Definition at line 267 of file kaldi-matrix.cc.
|
inline |
this <– beta*this + alpha*A*B.
Definition at line 708 of file kaldi-matrix.h.
Referenced by AmSgmm2::ComputeNormalizersInternal(), MleAmSgmm2Updater::MapUpdateM(), OnlineNaturalGradientSimple::PreconditionDirectionsCpu(), OnlinePreconditionerSimple::PreconditionDirectionsCpu(), kaldi::TraceMatSpMatSp(), kaldi::UnitTestAddMat2Sp(), kaldi::UnitTestSolve(), EbwAmSgmm2Updater::UpdateM(), and EbwAmSgmm2Updater::UpdateN().
|
inline |
this <– beta*this + alpha*A*B.
Definition at line 725 of file kaldi-matrix.h.
Referenced by IvectorExtractorStats::CommitStatsForW(), Sgmm2Project::ComputeLdaTransform(), kaldi::UnitTestCuMatrixAddMatTp(), and PldaUnsupervisedAdaptor::UpdatePlda().
void AddRows | ( | Real | alpha, |
const MatrixBase< Real > & | src, | ||
const MatrixIndexT * | indexes | ||
) |
Does for each row r, this.Row(r) += alpha * src.row(indexes[r]).
If indexes[r] < 0, does not add anything. all elements of "indexes" must be in [-1, src.NumRows()-1], and src.NumCols() must equal this.NumCols().
Definition at line 2918 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ColRange().
void AddRows | ( | Real | alpha, |
const Real *const * | src | ||
) |
Does for each row r, this.Row(r) += alpha * src[r], treating src[r] as the beginning of a region of memory representing a vector of floats, of the same length as this.NumCols().
If src[r] is NULL, does not add anything.
Definition at line 2935 of file kaldi-matrix.cc.
void AddSmat | ( | Real | alpha, |
const SparseMatrix< Real > & | A, | ||
MatrixTransposeType | trans = kNoTrans |
||
) |
*this += alpha * A [or A^T].
Definition at line 407 of file kaldi-matrix.cc.
Referenced by kaldi::UnitTextCuMatrixAddSmat().
void AddSmatMat | ( | Real | alpha, |
const SparseMatrix< Real > & | A, | ||
MatrixTransposeType | transA, | ||
const MatrixBase< Real > & | B, | ||
Real | beta | ||
) |
(*this) = alpha * op(A) * B + beta * (*this), where A is sparse.
Multiplication of sparse with dense matrix. See also AddMatSmat.
Definition at line 437 of file kaldi-matrix.cc.
Referenced by SpMatrix< float >::AddSmat2Sp(), kaldi::UnitTestAddMatSmat(), kaldi::UnitTestMatrixAddSmatMat(), and kaldi::UnitTextCuMatrixAddSmatMat().
void AddSmatMat | ( | const Real | alpha, |
const MatrixBase< Real > & | A, | ||
MatrixTransposeType | transA, | ||
const MatrixBase< Real > & | B, | ||
MatrixTransposeType | transB, | ||
const Real | beta | ||
) |
A version of AddMatMat specialized for when the first argument contains a lot of zeroes.
Definition at line 305 of file kaldi-matrix.cc.
*this += alpha * S
Definition at line 551 of file kaldi-matrix.cc.
Referenced by RegtreeFmllrDiagGmmAccs::AccumulateForGmm(), and kaldi::UnitTestAddSp().
|
inline |
this <– beta*this + alpha*SpA*B.
Definition at line 692 of file kaldi-matrix.h.
Referenced by FmllrSgmm2Accs::FmllrObjGradient(), and MleAmSgmm2Updater::MapUpdateM().
|
inline |
this <– beta*this + alpha*A*B*C.
Definition at line 716 of file kaldi-matrix.h.
void AddSpSp | ( | const Real | alpha, |
const SpMatrix< Real > & | A, | ||
const SpMatrix< Real > & | B, | ||
const Real | beta | ||
) |
this <– beta*this + alpha*A*B.
Definition at line 342 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::AddTpTp(), and kaldi::UnitTestMmulSym().
void AddToDiag | ( | const Real | alpha | ) |
Add a scalar to each diagonal element.
Definition at line 1686 of file kaldi-matrix.cc.
Referenced by kaldi::UnitTestCuMatrixAddToDiag().
void AddToRows | ( | Real | alpha, |
Real *const * | dst | ||
) | const |
For each row r of this matrix, adds it (times alpha) to the array of floats at the location given by dst[r].
If dst[r] is NULL, does not do anything for that row. Requires that none of the memory regions pointed to by the pointers in "dst" overlap (e.g. none of the pointers should be the same).
Definition at line 2965 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ColRange(), and kaldi::UnitTestAddToRows().
void AddToRows | ( | Real | alpha, |
const MatrixIndexT * | indexes, | ||
MatrixBase< Real > * | dst | ||
) | const |
For each row i of *this, adds this->Row(i) to dst->Row(indexes(i)) if indexes(i) >= 0, else do nothing.
Requires that all the indexes[i] that are >= 0 be distinct, otherwise the behavior is undefined.
Definition at line 2948 of file kaldi-matrix.cc.
|
inline |
this <– beta*this + alpha*A*B.
Definition at line 700 of file kaldi-matrix.h.
Referenced by kaldi::UnitTestCuMatrixAddTpMat().
|
inline |
this <– beta*this + alpha*A*B.
Definition at line 734 of file kaldi-matrix.h.
template void AddVecToCols | ( | const Real | alpha, |
const VectorBase< OtherReal > & | v | ||
) |
[each col of *this] += alpha * v
Definition at line 3061 of file kaldi-matrix.cc.
Referenced by kaldi::UnitTestAddVecToCols(), kaldi::UnitTestAddVecToColsSpeed(), and kaldi::UnitTestCuMatrixAddVecToCols().
template void AddVecToRows | ( | const Real | alpha, |
const VectorBase< OtherReal > & | v | ||
) |
[each row of *this] += alpha * v
Definition at line 3030 of file kaldi-matrix.cc.
Referenced by kaldi::ApplyCmvn(), kaldi::ApplyCmvnReverse(), AmSgmm2::ComponentLogLikes(), DecodableAmNnetParallel::Compute(), OnlineLdaInput::TransformToOutput(), kaldi::UnitTestAddVecToRows(), kaldi::UnitTestAddVecToRowsSpeed(), kaldi::UnitTestCuMatrixAddVecToRows(), and kaldi::UnitTestPldaEstimation().
void AddVecVec | ( | const float | alpha, |
const VectorBase< float > & | ra, | ||
const VectorBase< float > & | rb | ||
) |
void AddVecVec | ( | const double | alpha, |
const VectorBase< double > & | ra, | ||
const VectorBase< double > & | rb | ||
) |
void AddVecVec | ( | const float | alpha, |
const VectorBase< float > & | a, | ||
const VectorBase< float > & | rb | ||
) |
Definition at line 119 of file kaldi-matrix.cc.
void AddVecVec | ( | const double | alpha, |
const VectorBase< double > & | a, | ||
const VectorBase< double > & | rb | ||
) |
Definition at line 161 of file kaldi-matrix.cc.
void AddVecVec | ( | const Real | alpha, |
const VectorBase< OtherReal > & | a, | ||
const VectorBase< OtherReal > & | b | ||
) |
*this += alpha * a * b^T
Definition at line 129 of file kaldi-matrix.cc.
Referenced by AccumFullGmm::AccumulateFromPosteriors(), AccumDiagGmm::AccumulateFromPosteriors(), FmllrRawAccs::CommitSingleFrameStats(), FmllrDiagGmmAccs::CommitSingleFrameStats(), MleAmSgmm2Accs::CommitStatsForSpk(), IvectorExtractorStats::CommitStatsForWPoint(), FmllrDiagGmmAccs::FmllrDiagGmmAccs(), IvectorExtractor::GetAcousticAuxfWeight(), main(), kaldi::UnitInvert(), kaldi::UnitTestAddVecToCols(), kaldi::UnitTestAddVecToRows(), kaldi::UnitTestAddVecVec(), kaldi::UnitTestCholesky(), kaldi::UnitTestCuMatrixAddVecVec(), UnitTestEstimateFullGmm(), kaldi::UnitTestInvert(), kaldi::nnet2::UnitTestPreconditionDirectionsOnline(), kaldi::nnet3::UnitTestPreconditionDirectionsOnline(), kaldi::UnitTestSger(), kaldi::UnitTestSpAddVecVec(), and IvectorExtractorStats::UpdatePrior().
|
inline |
Definition at line 358 of file kaldi-matrix.h.
Referenced by kaldi::UnitTestCuMatrixApplyCeiling(), and kaldi::UnitTestCuMatrixApplyExpLimited().
|
inline |
Definition at line 362 of file kaldi-matrix.h.
Referenced by AmSgmm2::ComponentPosteriors(), ComputeScores(), AmSgmm2::LogLikelihood(), main(), kaldi::UnitTestCuDiffLogSoftmax(), kaldi::UnitTestCuMatrixApplyExp(), kaldi::UnitTestCuMatrixApplyExpLimited(), and kaldi::UnitTestSimple().
|
inline |
Definition at line 370 of file kaldi-matrix.h.
|
inline |
Definition at line 366 of file kaldi-matrix.h.
Referenced by kaldi::UnitTestApplyExpSpecial(), and kaldi::UnitTestCuMatrixApplyExpSpecial().
|
inline |
Definition at line 354 of file kaldi-matrix.h.
Referenced by DecodableAmNnetParallel::Compute(), main(), KlHmm::PropagateFnc(), kaldi::UnitTestApplyExpSpecial(), kaldi::UnitTestCuMathNormalizePerRow_v2(), kaldi::UnitTestCuMatrixApplyExpLimited(), kaldi::UnitTestCuMatrixApplyFloor(), kaldi::UnitTestCuMatrixDiffGroupPnorm(), kaldi::UnitTestCuMatrixGroupMax(), kaldi::UnitTestCuMatrixGroupMaxDeriv(), and kaldi::UnitTestCuMatrixGroupPnorm().
|
inline |
Definition at line 350 of file kaldi-matrix.h.
Referenced by kaldi::UnitTestCuMatrixApplyHeaviside(), kaldi::UnitTestCuMatrixHeaviside(), and kaldi::UnitTestHeaviside().
|
inline |
Definition at line 374 of file kaldi-matrix.h.
Referenced by DecodableAmNnetParallel::Compute(), main(), KlHmm::PropagateFnc(), and kaldi::UnitTestCuMatrixApplyLog().
|
inline |
Definition at line 341 of file kaldi-matrix.h.
Referenced by Fmpe::ComputeStddevs(), DiagGmm::LogLikelihoods(), main(), kaldi::UnitTestCuMatrixApplyPow(), kaldi::UnitTestSetRandn(), and kaldi::UnitTestSetRandUniform().
|
inline |
Definition at line 346 of file kaldi-matrix.h.
Referenced by kaldi::UnitTestCuMatrixApplyPowAbs().
Real ApplySoftMax | ( | ) |
Apply soft-max to the collection of all elements of the matrix and return normalizer (log sum of exponentials).
Definition at line 2751 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::MinSingularValue(), and kaldi::UnitTestSimpleForMat().
bool ApproxEqual | ( | const MatrixBase< Real > & | other, |
float | tol = 0.01 |
||
) | const |
Returns true if ((*this)-other).FrobeniusNorm() <= tol * (*this).FrobeniusNorm().
Definition at line 1915 of file kaldi-matrix.cc.
Referenced by kaldi::ApproxEqual(), AccumDiagGmm::AssertEqual(), kaldi::AssertEqual(), MatrixBase< float >::MinSingularValue(), SingleUtteranceGmmDecoder::RescoringIsNeeded(), kaldi::TestOnlineCmnInput(), kaldi::TestOnlineDeltaFeature(), kaldi::TestOnlineDeltaInput(), kaldi::TestOnlineLdaInput(), kaldi::TestOnlineSpliceFrames(), kaldi::UnitTestExtractCompressedMatrix(), kaldi::UnitTestNorm(), kaldi::UnitTestPosteriors(), and kaldi::UnitTestTableRandomBothDoubleMatrix().
void Ceiling | ( | const MatrixBase< Real > & | src, |
Real | ceiling_val | ||
) |
Definition at line 2173 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ApplyCeiling(), and MatrixBase< float >::MinSingularValue().
|
inline |
Definition at line 213 of file kaldi-matrix.h.
Referenced by kaldi::AppendPostToFeats(), kaldi::AppendVectorToFeats(), OnlineFeaturePipeline::Init(), and main().
Real Cond | ( | ) | const |
Returns condition number by computing Svd.
Works even if cols > rows. Returns infinity if all singular values are zero.
Definition at line 1696 of file kaldi-matrix.cc.
Referenced by SpMatrix< float >::Cond(), InitRand(), kaldi::InitRand(), kaldi::InitRandNonsingular(), MatrixBase< float >::MinSingularValue(), rand_posdef_spmatrix(), kaldi::RandFullCova(), kaldi::unittest::RandPosdefSpMatrix(), RandPosdefSpMatrix(), kaldi::UnitTestPldaEstimation(), and kaldi::UnitTestRegtreeFmllrDiagGmm().
void CopyColFromVec | ( | const VectorBase< Real > & | v, |
const MatrixIndexT | col | ||
) |
Copy vector into specific column of matrix.
Definition at line 1102 of file kaldi-matrix.cc.
Referenced by LdaEstimate::AddMeanOffset(), FmllrDiagGmmAccs::FmllrDiagGmmAccs(), AmSgmm2::InitializeMw(), main(), MatrixBase< float >::operator()(), ArbitraryResample::Resample(), kaldi::UnitTestCuMathNormalizePerRow(), and kaldi::UnitTestSpliceRows().
void CopyCols | ( | const MatrixBase< Real > & | src, |
const MatrixIndexT * | indices | ||
) |
Copies column r from column indices[r] of src.
As a special case, if indexes[i] == -1, sets column i to zero. all elements of "indices" must be in [-1, src.NumCols()-1], and src.NumRows() must equal this.NumRows()
Definition at line 2826 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ColRange().
void CopyColsFromVec | ( | const VectorBase< Real > & | v | ) |
Copies vector into matrix, column-by-column.
Note that rv.Dim() must either equal NumRows()*NumCols() or NumRows(); this has two modes of operation.
Definition at line 1053 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::operator()(), kaldi::UnitTestCuMatrixCopyColsFromVec(), and kaldi::UnitTestSpliceRows().
void CopyDiagFromVec | ( | const VectorBase< Real > & | v | ) |
Copy vector into diagonal of matrix.
Definition at line 1093 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::operator()(), kaldi::UnitTestAddVec2Sp(), kaldi::UnitTestSpliceRows(), and kaldi::UnitTestSvd().
void CopyFromMat | ( | const MatrixBase< OtherReal > & | M, |
MatrixTransposeType | trans = kNoTrans |
||
) |
Copy given matrix. (no resize is done).
Definition at line 862 of file kaldi-matrix.cc.
Referenced by DecodableNnetSimpleLooped::AdvanceChunk(), kaldi::ApplyFeatureTransformToStats(), kaldi::CalBasisFmllrStepSize(), kaldi::CalcFmllrStepSize(), kaldi::ComposeTransforms(), OnlineMatrixInput::Compute(), kaldi::ComputeFmllrMatrixDiagGmmDiagonal(), kaldi::ComputeFmllrMatrixDiagGmmFull(), kaldi::ComputeFmllrMatrixDiagGmmOffset(), AmSgmm2::ComputeFmllrPreXform(), kaldi::ComputeLdaTransform(), kaldi::ComputeMllrMatrix(), MleAmSgmm2Updater::ComputeMPrior(), Fmpe::ComputeStddevs(), LinearVtln::ComputeTransform(), BasisFmllrEstimate::ComputeTransform(), CompressedAffineXformStats::CopyFromAffineXformStats(), DiagGmmNormal::CopyFromDiagGmm(), FullGmm::CopyFromDiagGmm(), DiagGmm::CopyFromDiagGmm(), FullGmm::CopyFromFullGmm(), DiagGmm::CopyFromFullGmm(), AffineXformStats::CopyStats(), CompressedAffineXformStats::CopyToAffineXformStats(), DiagGmmNormal::CopyToDiagGmm(), CompressedMatrix::CopyToMat(), CuMatrixBase< float >::CopyToMat(), GeneralMatrix::CopyToMat(), OnlineDeltaInput::DeltaComputation(), LdaEstimate::Estimate(), FeatureTransformEstimate::EstimateInternal(), kaldi::EstPca(), kaldi::ExtractObjectRange(), kaldi::FmllrAuxfGradient(), kaldi::FmllrInnerUpdate(), FmllrSgmm2Accs::FmllrObjGradient(), kaldi::nnet2::FormatNnetInput(), kaldi::generate_features(), OnlineCmvn::GetFrame(), LogisticRegression::GetLogPosteriors(), DiagGmm::GetMeans(), OnlineCmvn::GetMostRecentCachedFrame(), AmSgmm2::GetNtransSigmaInv(), LinearVtln::GetTransform(), DiagGmm::GetVars(), RegtreeFmllrDiagGmm::GetXformMatrix(), AmSgmm2::IncreasePhoneSpaceDim(), AmSgmm2::IncreaseSpkSpaceDim(), CuMatrixBase< float >::LogSoftMaxPerRow(), main(), MleAmSgmm2Updater::MapUpdateM(), MfccComputer::MfccComputer(), LogisticRegression::MixUp(), OnlineLdaInput::OnlineLdaInput(), MatrixBase< float >::operator()(), Matrix< BaseFloat >::operator=(), OnlineNaturalGradientSimple::PreconditionDirections(), OnlinePreconditionerSimple::PreconditionDirections(), OnlineNaturalGradientSimple::PreconditionDirectionsCpu(), OnlinePreconditionerSimple::PreconditionDirectionsCpu(), AffineXformStats::Read(), FullGmm::SetInvCovarsAndMeansInvCovars(), DiagGmm::SetInvVars(), DiagGmm::SetInvVarsAndMeans(), DiagGmm::SetMeans(), KlHmm::SetStats(), LogisticRegression::SetWeights(), kaldi::SlidingWindowCmn(), CuMatrixBase< float >::SoftMaxPerRow(), kaldi::SolveQuadraticMatrixProblem(), MatrixBase< float >::Svd(), NoOpTransform::TestingForward(), SpMatrix< float >::TopEigs(), LogisticRegression::Train(), kaldi::UnitTestAddMatDiagVec(), kaldi::UnitTestAddMatMatElements(), kaldi::UnitTestCuCopy(), kaldi::UnitTestCuDiffLogSoftmax(), kaldi::UnitTestCuDiffSoftmax(), kaldi::UnitTestCuLogSoftmax(), kaldi::UnitTestCuMathNormalizePerRow(), kaldi::UnitTestCuMathNormalizePerRow_v2(), kaldi::UnitTestCuMatrixCopyCross2(), kaldi::UnitTestCuSoftmax(), kaldi::UnitTestDiagGmm(), UnitTestEstimateDiagGmm(), kaldi::UnitTestEstimateMmieDiagGmm(), UnitTestFullGmm(), kaldi::UnitTestIoCross(), kaldi::UnitTestMax2(), kaldi::UnitTestMulElements(), kaldi::UnitTestPca2(), kaldi::UnitTestRegtreeFmllrDiagGmm(), kaldi::UnitTestScale(), kaldi::UnitTestSvd(), kaldi::UnitTestSvdZero(), kaldi::UnitTestSwapCu2M(), kaldi::UnitTestTrace(), kaldi::UnitTestTrain(), MlltAccs::Update(), FmllrDiagGmmAccs::Update(), FmllrRawAccs::Update(), FmllrSgmm2Accs::Update(), PldaUnsupervisedAdaptor::UpdatePlda(), MleAmSgmm2Updater::UpdateW(), and AccumDiagGmm::Write().
void CopyFromMat | ( | const CompressedMatrix & | M | ) |
Copy from compressed matrix.
Definition at line 2057 of file kaldi-matrix.cc.
void CopyFromMat | ( | const CuMatrixBase< OtherReal > & | M, |
MatrixTransposeType | trans = kNoTrans |
||
) |
Copy from CUDA matrix. Implemented in ../cudamatrix/cu-matrix.h.
Definition at line 975 of file cu-matrix.h.
Copy given spmatrix. (no resize is done).
Definition at line 938 of file kaldi-matrix.cc.
Referenced by AmSgmm2::GetNtransSigmaInv(), SpMatrix< float >::Invert(), Matrix< BaseFloat >::Matrix(), MatrixBase< float >::operator()(), kaldi::RandFullCova(), kaldi::UnitTestAddMat2(), and kaldi::UnitTestTransposeScatter().
Definition at line 904 of file kaldi-matrix.cc.
void CopyFromSp | ( | const SpMatrix< double > & | M | ) |
Definition at line 921 of file kaldi-matrix.cc.
template void CopyFromTp | ( | const TpMatrix< OtherReal > & | M, |
MatrixTransposeType | trans = kNoTrans |
||
) |
Copy given tpmatrix. (no resize is done).
Definition at line 958 of file kaldi-matrix.cc.
Referenced by kaldi::ComputeFeatureNormalizingTransform(), AmSgmm2::ComputeFmllrPreXform(), kaldi::ComputeNormalizingTransform(), BasisFmllrEstimate::EstimateFmllrBasis(), Matrix< BaseFloat >::Matrix(), MatrixBase< float >::operator()(), MleAmSgmm2Updater::RenormalizeV(), OnlineNaturalGradient::ReorthogonalizeRt1(), OnlinePreconditioner::ReorthogonalizeXt1(), kaldi::UnitTestCuMatrixCopyFromTp(), and kaldi::UnitTestMul().
void CopyLowerToUpper | ( | ) |
Copy lower triangle to upper triangle (symmetrize)
Definition at line 212 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::AddTpTp(), OnlinePreconditioner::PreconditionDirectionsInternal(), and OnlineNaturalGradient::PreconditionDirectionsInternal().
void CopyRowFromVec | ( | const VectorBase< Real > & | v, |
const MatrixIndexT | row | ||
) |
Copy vector into specific row of matrix.
Definition at line 1081 of file kaldi-matrix.cc.
Referenced by kaldi::ClusterGaussiansToUbm(), kaldi::FmllrAuxfGradient(), kaldi::GetOutput(), main(), kaldi::MapDiagGmmUpdate(), kaldi::MleDiagGmmUpdate(), kaldi::MleFullGmmUpdate(), MatrixBase< float >::operator()(), DiagGmm::SetComponentMean(), kaldi::UnitTestSpliceRows(), and kaldi::UpdateEbwDiagGmm().
void CopyRows | ( | const MatrixBase< Real > & | src, |
const MatrixIndexT * | indices | ||
) |
Copies row r from row indices[r] of src (does nothing As a special case, if indexes[i] == -1, sets row i to zero.
all elements of "indices" must be in [-1, src.NumRows()-1], and src.NumCols() must equal this.NumCols()
Definition at line 2877 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ColRange().
void CopyRows | ( | const Real *const * | src | ) |
Copies row r of this matrix from an array of floats at the location given by src[r].
If any src[r] is NULL then this.Row(r) will be set to zero. Note: we are using "pointer to const pointer to const object" for "src", because we may create "src" by calling Data() of const CuArray
Definition at line 2892 of file kaldi-matrix.cc.
void CopyRowsFromVec | ( | const VectorBase< Real > & | v | ) |
This function has two modes of operation.
If v.Dim() == NumRows() * NumCols(), then treats the vector as a row-by-row concatenation of a matrix and copies to *this. if v.Dim() == NumCols(), it sets each row of *this to a copy of v.
Definition at line 997 of file kaldi-matrix.cc.
Referenced by DecodableNnetLoopedOnlineBase::AdvanceChunk(), DecodableNnetSimpleLooped::AdvanceChunk(), kaldi::nnet2::CombineNnets(), FastNnetCombiner::ComputeCurrentNnet(), FmllrRawAccs::ConvertToPerRowStats(), kaldi::CuVectorUnitTestCopyFromMat(), LogisticRegression::DoStep(), kaldi::nnet2::FormatNnetInput(), OnlineTransform::GetFrames(), DiagGmm::LogLikelihoods(), MatrixBase< float >::operator()(), LogisticRegression::TrainParameters(), kaldi::UnitTestCopyRowsAndCols(), kaldi::UnitTestCuMatrixCopyRowsFromVec(), and kaldi::UnitTestSpliceRows().
void CopyRowsFromVec | ( | const CuVectorBase< Real > & | v | ) |
This version of CopyRowsFromVec is implemented in ../cudamatrix/cu-vector.cc.
Definition at line 246 of file cu-vector.cc.
void CopyRowsFromVec | ( | const VectorBase< OtherReal > & | v | ) |
Definition at line 1024 of file kaldi-matrix.cc.
void CopyToRows | ( | Real *const * | dst | ) | const |
Copies row r of this matrix to the array of floats at the location given by dst[r].
If dst[r] is NULL, does not copy anywhere. Requires that none of the memory regions pointed to by the pointers in "dst" overlap (e.g. none of the pointers should be the same).
Definition at line 2905 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ColRange(), and kaldi::UnitTestCopyToRows().
void CopyUpperToLower | ( | ) |
Copy upper triangle to lower triangle (symmetrize)
Definition at line 223 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::AddTpTp().
|
inline |
Gives pointer to raw data (const).
Definition at line 79 of file kaldi-matrix.h.
Referenced by VectorBase< float >::AddDiagMat2(), VectorBase< float >::AddDiagMatMat(), MatrixBase< float >::AddDiagVecMat(), SpMatrix< float >::AddMat2(), SpMatrix< float >::AddMat2Sp(), SpMatrix< float >::AddMat2Vec(), MatrixBase< float >::AddMatDiagVec(), MatrixBase< float >::AddMatMatElements(), MatrixBase< float >::AddMatSmat(), VectorBase< float >::AddMatSvec(), VectorBase< float >::AddMatVec(), kaldi::AddOuterProductPlusMinus(), VectorBase< float >::AddRowSumMat(), SpMatrix< float >::AddSmat2Sp(), SparseMatrix< float >::AddToMat(), MatrixBase< float >::Ceiling(), VectorBase< float >::CopyColsFromMat(), VectorBase< float >::CopyDiagFromMat(), TpMatrix< float >::CopyFromMat(), SpMatrix< float >::CopyFromMat(), CompressedMatrix::CopyFromMat(), MatrixBase< float >::CopyFromMat(), CuMatrixBase< float >::CopyFromMat(), CuVectorBase< float >::CopyRowsFromMat(), VectorBase< float >::CopyRowsFromMat(), SparseMatrix< float >::CopyToMat(), CuMatrixBase< float >::CopyToMat(), kaldi::cu::CpuComputeLstmNonlinearity(), DecodableMatrixMapped::DecodableMatrixMapped(), MatrixBase< float >::Exp(), MatrixBase< float >::ExpLimited(), MatrixBase< float >::ExpSpecial(), MatrixBase< float >::Floor(), MatrixBase< float >::Heaviside(), TpMatrix< float >::Invert(), MatrixBase< float >::LapackGesvd(), MatrixBase< float >::Log(), MatrixBase< float >::Pow(), MatrixBase< float >::PowAbs(), kaldi::QrStep(), MatrixBase< float >::SymAddMat2(), kaldi::TraceMatSmat(), kaldi::TraceSpMat(), SpMatrix< float >::Tridiagonalize(), kaldi::UnitTestCuDiffNormalizePerRow(), and kaldi::UnitTestCuMathNormalizePerRow().
|
inline |
|
inlineprotected |
A workaround that allows SubMatrix to get a pointer to non-const data for const Matrix.
Unfortunately C++ does not allow us to declare a "public const" inheritance or anything like that, so it would require a lot of work to make the SubMatrix class totally const-correct– we would have to override many of the Matrix functions.
Definition at line 803 of file kaldi-matrix.h.
Referenced by SubMatrix< Real >::SubMatrix().
void DestructiveSvd | ( | VectorBase< Real > * | s, |
MatrixBase< Real > * | U, | ||
MatrixBase< Real > * | Vt | ||
) |
Singular value decomposition Major limitations: For nonsquare matrices, we assume m>=n (NumRows >= NumCols), and we return the "skinny" Svd, i.e.
the matrix in the middle is diagonal, and the one on the left is rectangular.
In Svd, *this = U*diag(S)*Vt. Null pointers for U and/or Vt at input mean we do not want that output. We expect that S.Dim() == m, U is either NULL or m by n, and v is either NULL or n by n. The singular values are not sorted (use SortSvd for that).
Definition at line 1781 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ApplyLog(), kaldi::ComputePca(), AffineComponent::LimitRank(), and MatrixBase< float >::Svd().
void DiffSigmoid | ( | const MatrixBase< Real > & | value, |
const MatrixBase< Real > & | diff | ||
) |
Definition at line 2994 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::MinSingularValue(), and kaldi::UnitTestSigmoid().
void DiffTanh | ( | const MatrixBase< Real > & | value, |
const MatrixBase< Real > & | diff | ||
) |
Definition at line 3011 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::MinSingularValue(), and kaldi::UnitTestTanh().
void DivElements | ( | const MatrixBase< Real > & | A | ) |
Divide each element by the corresponding element of a given matrix.
Definition at line 1157 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ColRange(), and kaldi::UnitTestCuMatrixDivElements().
void Eig | ( | MatrixBase< Real > * | P, |
VectorBase< Real > * | eigs_real, | ||
VectorBase< Real > * | eigs_imag | ||
) | const |
Eigenvalue Decomposition of a square NxN matrix into the form (*this) = P D P^{-1}.
Be careful: the relationship of D to the eigenvalues we output is slightly complicated, due to the need for P to be real. In the symmetric case D is diagonal and real, but in the non-symmetric case there may be complex-conjugate pairs of eigenvalues. In this case, for the equation (*this) = P D P^{-1} to hold, D must actually be block diagonal, with 2x2 blocks corresponding to any such pairs. If a pair is lambda +- i*mu, D will have a corresponding 2x2 block [lambda, mu; -mu, lambda]. Note that if the input matrix (*this) is non-invertible, P may not be invertible so in this case instead of the equation (*this) = P D P^{-1} holding, we have instead (*this) P = P D.
The non-member function CreateEigenvalueMatrix creates D from eigs_real and eigs_imag.
Definition at line 2280 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ApplyLog(), kaldi::UnitTestEig(), and kaldi::UnitTestEigSymmetric().
bool Equal | ( | const MatrixBase< Real > & | other | ) | const |
Tests for exact equality. It's usually preferable to use ApproxEqual.
Definition at line 1925 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::MinSingularValue().
void Exp | ( | const MatrixBase< Real > & | src | ) |
Definition at line 2115 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ApplyExp(), and MatrixBase< float >::MinSingularValue().
void ExpLimited | ( | const MatrixBase< Real > & | src, |
Real | lower_limit, | ||
Real | upper_limit | ||
) |
This is equivalent to running: Floor(src, lower_limit); Ceiling(src, upper_limit); Exp(src)
Definition at line 2212 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ApplyExpLimited(), and MatrixBase< float >::MinSingularValue().
void ExpSpecial | ( | const MatrixBase< Real > & | src | ) |
For each element x of the matrix, set it to (x < 0 ? exp(x) : x + 1).
This function is used in our RNNLM training.
Definition at line 2199 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ApplyExpSpecial(), and MatrixBase< float >::MinSingularValue().
void Floor | ( | const MatrixBase< Real > & | src, |
Real | floor_val | ||
) |
Definition at line 2160 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ApplyFloor(), and MatrixBase< float >::MinSingularValue().
Real FrobeniusNorm | ( | ) | const |
Frobenius norm, which is the sqrt of sum of square elements.
Same as Schatten 2-norm, or just "2-norm".
Definition at line 1910 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ApproxEqual(), MleAmSgmm2Accs::Check(), MatrixBase< float >::MinSingularValue(), MatrixBase< float >::SymPosSemiDefEig(), kaldi::UnitTestCompressedMatrix(), kaldi::UnitTestGeneralMatrix(), kaldi::UnitTestNorm(), and kaldi::UnitTestSparseMatrixFrobeniusNorm().
void GroupMax | ( | const MatrixBase< Real > & | src | ) |
Apply the function y(i) = (max_{j = i*G}^{(i+1)*G-1} x_j Requires src.NumRows() == this->NumRows() and src.NumCols() % this->NumCols() == 0.
Definition at line 2806 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::MinSingularValue(), kaldi::UnitTestCuMatrixGroupMax(), and kaldi::UnitTestCuMatrixGroupMaxDeriv().
void GroupMaxDeriv | ( | const MatrixBase< Real > & | input, |
const MatrixBase< Real > & | output | ||
) |
Calculate derivatives for the GroupMax function above, where "input" is the input to the GroupMax function above (i.e.
the "src" variable), and "output" is the result of the computation (i.e. the "this" of that function call), and *this must have the same dimension as "input". Each element of *this will be set to 1 if the corresponding input equals the output of the group, and 0 otherwise. The equals the function derivative where it is defined (it's not defined where multiple inputs in the group are equal to the output).
Definition at line 1299 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::MinSingularValue(), and kaldi::UnitTestCuMatrixGroupMaxDeriv().
void GroupPnorm | ( | const MatrixBase< Real > & | src, |
Real | power | ||
) |
Apply the function y(i) = (sum_{j = i*G}^{(i+1)*G-1} x_j^(power))^(1 / p).
Requires src.NumRows() == this->NumRows() and src.NumCols() % this->NumCols() == 0.
Definition at line 2795 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::MinSingularValue(), kaldi::UnitTestCuMatrixDiffGroupPnorm(), and kaldi::UnitTestCuMatrixGroupPnorm().
void GroupPnormDeriv | ( | const MatrixBase< Real > & | input, |
const MatrixBase< Real > & | output, | ||
Real | power | ||
) |
Calculate derivatives for the GroupPnorm function above...
if "input" is the input to the GroupPnorm function above (i.e. the "src" variable), and "output" is the result of the computation (i.e. the "this" of that function call), and *this has the same dimension as "input", then it sets each element of *this to the derivative d(output-elem)/d(input-elem) for each element of "input", where "output-elem" is whichever element of output depends on that input element.
Definition at line 1255 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::MinSingularValue(), and kaldi::UnitTestCuMatrixDiffGroupPnorm().
void Heaviside | ( | const MatrixBase< Real > & | src | ) |
Sets each element to the Heaviside step function (x > 0 ? 1 : 0) of the corresponding element in "src".
Note: in general you can make different choices for x = 0, but for now please leave it as it (i.e. returning zero) because it affects the RectifiedLinearComponent in the neural net code.
Definition at line 2102 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ApplyHeaviside(), and MatrixBase< float >::MinSingularValue().
|
inline |
Indexing operator, provided for ease of debugging (gdb doesn't work with parenthesis operator).
Definition at line 111 of file kaldi-matrix.h.
void Invert | ( | Real * | log_det = NULL , |
Real * | det_sign = NULL , |
||
bool | inverse_needed = true |
||
) |
matrix inverse.
if inverse_needed = false, will fill matrix with garbage. (only useful if logdet wanted).
Definition at line 38 of file kaldi-matrix.cc.
Referenced by kaldi::CholeskyUnitTestTr(), MatrixBase< float >::ColRange(), LdaEstimate::Estimate(), FeatureTransformEstimate::EstimateInternal(), kaldi::FmllrInnerUpdate(), kaldi::generate_features(), IvectorExtractorStats::GetOrthogonalIvectorTransform(), SpMatrix< float >::Invert(), MatrixBase< float >::InvertDouble(), MatrixBase< float >::LogDet(), MatrixBase< float >::Power(), MleAmSgmm2Updater::RenormalizeV(), kaldi::SolveDoubleQuadraticMatrixProblem(), IvectorExtractor::TransformIvectors(), kaldi::UnitTestEig(), kaldi::UnitTestNonsymmetricPower(), MlltAccs::Update(), and PldaUnsupervisedAdaptor::UpdatePlda().
void InvertDouble | ( | Real * | LogDet = NULL , |
Real * | det_sign = NULL , |
||
bool | inverse_needed = true |
||
) |
matrix inverse [double].
if inverse_needed = false, will fill matrix with garbage (only useful if logdet wanted). Does inversion in double precision even if matrix was not double.
Definition at line 2046 of file kaldi-matrix.cc.
Referenced by kaldi::CalBasisFmllrStepSize(), kaldi::CalcFmllrStepSize(), MatrixBase< float >::ColRange(), kaldi::ComputeFeatureNormalizingTransform(), and BasisFmllrEstimate::ComputeTransform().
void InvertElements | ( | ) |
Inverts all the elements of the matrix.
Definition at line 2070 of file kaldi-matrix.cc.
Referenced by kaldi::ClusterGaussiansToUbm(), MatrixBase< float >::ColRange(), DiagGmmNormal::CopyFromDiagGmm(), DiagGmmNormal::CopyToDiagGmm(), DiagGmm::GetMeans(), DiagGmm::GetVars(), init_rand_diag_gmm(), DiagGmm::Merge(), KlHmm::PropagateFnc(), rand_diag_gmm(), DiagGmm::SetInvVars(), kaldi::UnitTestCuMatrixInvertElements(), kaldi::UnitTestDiagGmm(), UnitTestEstimateDiagGmm(), kaldi::UnitTestEstimateMmieDiagGmm(), and kaldi::UnitTestRegtreeFmllrDiagGmm().
bool IsDiagonal | ( | Real | cutoff = 1.0e-05 | ) | const |
Returns true if matrix is Diagonal.
Definition at line 1864 of file kaldi-matrix.cc.
Referenced by kaldi::ApplyModelTransformToStats(), MatrixBase< float >::MinSingularValue(), UnitTestEstimateLda(), and kaldi::UnitTestSimple().
bool IsSymmetric | ( | Real | cutoff = 1.0e-05 | ) | const |
Returns true if matrix is Symmetric.
Definition at line 1848 of file kaldi-matrix.cc.
Referenced by BasisFmllrEstimate::ComputeAmDiagPrecond(), EigenvalueDecomposition< Real >::EigenvalueDecomposition(), MatrixBase< float >::MinSingularValue(), MatrixBase< float >::SymPosSemiDefEig(), and kaldi::UnitTestSimple().
bool IsUnit | ( | Real | cutoff = 1.0e-05 | ) | const |
Returns true if the matrix is all zeros, except for ones on diagonal.
(it does not have to be square). More specifically, this function returns false if for any i, j, (*this)(i, j) differs by more than cutoff from the expression (i == j ? 1 : 0).
Definition at line 1890 of file kaldi-matrix.cc.
Referenced by kaldi::CholeskyUnitTestTr(), kaldi::ComputeFmllrMatrixDiagGmm(), MatrixBase< float >::MinSingularValue(), kaldi::nnet3::PerturbImage(), TestSgmm2PreXform(), kaldi::UnitTestDct(), UnitTestEstimateLda(), kaldi::UnitTestLimitCondInvert(), kaldi::UnitTestOrthogonalizeRows(), kaldi::UnitTestPca(), kaldi::UnitTestSimple(), kaldi::UnitTestSpInvert(), and kaldi::UnitTestTpInvert().
bool IsZero | ( | Real | cutoff = 1.0e-05 | ) | const |
Returns true if matrix is all zeros.
Definition at line 1900 of file kaldi-matrix.cc.
Referenced by BasisFmllrEstimate::ComputeTransform(), MatrixBase< float >::MinSingularValue(), test_io(), kaldi::TestFmpe(), kaldi::UnitTestDeterminant(), kaldi::UnitTestResize(), kaldi::UnitTestSimple(), FmllrDiagGmmAccs::Update(), and FmllrRawAccs::Update().
|
private |
void LapackGesvd | ( | VectorBase< Real > * | s, |
MatrixBase< Real > * | U, | ||
MatrixBase< Real > * | Vt | ||
) |
Impementation notes: Lapack works in column-order, therefore the dimensions of *this are swapped as well as the U and V matrices.
Definition at line 660 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::AddTpTp(), and MatrixBase< float >::DestructiveSvd().
Real LargestAbsElem | ( | ) | const |
largest absolute value.
Definition at line 1937 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::DestructiveSvd(), and MatrixBase< float >::MinSingularValue().
void Log | ( | const MatrixBase< Real > & | src | ) |
Definition at line 2186 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ApplyLog(), and MatrixBase< float >::MinSingularValue().
Real LogDet | ( | Real * | det_sign = NULL | ) | const |
Returns logdet of matrix.
Definition at line 2038 of file kaldi-matrix.cc.
Referenced by kaldi::CalBasisFmllrStepSize(), kaldi::CalcFmllrStepSize(), MatrixBase< float >::ColRange(), kaldi::ComputeFmllrLogDet(), RegtreeFmllrDiagGmm::ComputeLogDets(), kaldi::FmllrAuxfGradient(), kaldi::FmllrAuxFuncDiagGmm(), FmllrSgmm2Accs::FmllrObjGradient(), FmllrRawAccs::GetAuxf(), kaldi::UnitTestDeterminant(), kaldi::UnitTestDeterminantSign(), kaldi::UnitTestEig(), UnitTestEstimateFullGmm(), kaldi::UnitTestSimpleForMat(), and FmllrSgmm2Accs::Update().
Real LogSumExp | ( | Real | prune = -1.0 | ) | const |
Returns log(sum(exp())) without exp overflow If prune > 0.0, it uses a pruning beam, discarding terms less than (max - prune).
Note: in future we may change this so that if prune = 0.0, it takes the max, so use -1 if you don't want to prune.
Definition at line 2728 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::MinSingularValue(), and kaldi::UnitTestSimpleForMat().
Real Max | ( | ) | const |
Returns maximum element of matrix.
Definition at line 1717 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ColRange(), AmSgmm2::ComponentPosteriors(), CompressedMatrix::ComputeGlobalHeader(), AmSgmm2::LogLikelihood(), MatrixBase< float >::Svd(), kaldi::UnitTestCuMatrixMax(), kaldi::UnitTestCuMatrixReduceMax(), kaldi::UnitTestMax2(), and kaldi::UnitTestMaxMin().
void Max | ( | const MatrixBase< Real > & | A | ) |
Set, element-by-element, *this = max(*this, A)
Definition at line 1182 of file kaldi-matrix.cc.
Real Min | ( | ) | const |
Returns minimum element of matrix.
Definition at line 1728 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ColRange(), CompressedMatrix::ComputeGlobalHeader(), MatrixBase< float >::Svd(), kaldi::UnitTestCuMatrixMin(), kaldi::UnitTestCuMatrixReduceMin(), kaldi::UnitTestMaxMin(), and Fmpe::Update().
void Min | ( | const MatrixBase< Real > & | A | ) |
Set, element-by-element, *this = min(*this, A)
Definition at line 1195 of file kaldi-matrix.cc.
|
inline |
Returns smallest singular value.
Definition at line 430 of file kaldi-matrix.h.
void MulColsVec | ( | const VectorBase< Real > & | scale | ) |
Equivalent to (*this) = (*this) * diag(scale).
Scaling each column by a scalar taken from that dimension of the vector.
Definition at line 1319 of file kaldi-matrix.cc.
Referenced by kaldi::ApplyCmvn(), kaldi::ApplyCmvnReverse(), SpMatrix< float >::ApplyFloor(), SpMatrix< float >::ApplyPow(), MatrixBase< float >::ColRange(), AmSgmm2::ComponentPosteriors(), SvdApplier::DecomposeComponent(), SpMatrix< float >::LimitCond(), main(), MleAmSgmm2Updater::RenormalizeN(), kaldi::SolveQuadraticMatrixProblem(), MatrixBase< float >::SymPosSemiDefEig(), kaldi::UnitTestAddMatDiagVec(), kaldi::UnitTestCuMatrixMulColsVec(), kaldi::UnitTestEigSymmetric(), and kaldi::UnitTestScale().
void MulElements | ( | const MatrixBase< Real > & | A | ) |
Element by element multiplication with a given matrix.
Definition at line 1140 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ColRange(), DiagGmmNormal::CopyFromDiagGmm(), DiagGmm::CopyFromFullGmm(), DiagGmmNormal::CopyToDiagGmm(), DiagGmm::GetMeans(), DiagGmm::Merge(), DiagGmm::SetInvVars(), DiagGmm::SetInvVarsAndMeans(), DiagGmm::SetMeans(), kaldi::UnitTestAddMatMatElements(), kaldi::UnitTestCuDiffSoftmax(), kaldi::UnitTestCuMatrixApplyLog(), kaldi::UnitTestCuMatrixApplyPow(), kaldi::UnitTestCuMatrixMulElements(), kaldi::UnitTestCuMatrixSigmoid(), kaldi::UnitTestCuMatrixSoftHinge(), kaldi::UnitTestMulElements(), and kaldi::UnitTestSimpleForMat().
void MulRowsGroupMat | ( | const MatrixBase< Real > & | src | ) |
Divide each row into src.NumCols() equal groups, and then scale i'th row's j'th group of elements by src(i, j).
Requires src.NumRows() == this->NumRows() and this->NumCols() % src.NumCols() == 0.
Definition at line 1238 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ColRange(), kaldi::UnitTestCuMatrixDiffGroupPnorm(), and kaldi::UnitTestCuMatrixMulRowsGroupMat().
void MulRowsVec | ( | const VectorBase< Real > & | scale | ) |
Equivalent to (*this) = diag(scale) * (*this).
Scaling each row by a scalar taken from that dimension of the vector.
Definition at line 1224 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ColRange(), FeatureTransformEstimate::EstimateInternal(), AffineComponent::LimitRank(), LimitRankClass::operator()(), OnlineNaturalGradientSimple::PreconditionDirectionsCpu(), OnlinePreconditionerSimple::PreconditionDirectionsCpu(), KlHmm::PropagateFnc(), AccumDiagGmm::SmoothStats(), Plda::SmoothWithinClassCovariance(), kaldi::UnitTestCuDiffLogSoftmax(), kaldi::UnitTestCuDiffNormalizePerRow(), kaldi::UnitTestCuMathNormalizePerRow_v2(), kaldi::UnitTestCuMatrixDivRowsVec(), kaldi::UnitTestCuMatrixMulRowsVec(), kaldi::UnitTestScale(), and IvectorExtractorStats::UpdatePrior().
|
inline |
Returns number of columns (or zero for empty matrix).
Definition at line 67 of file kaldi-matrix.h.
Referenced by kaldi::AccCmvnStats(), kaldi::AccCmvnStatsForPair(), DecodableMatrixMappedOffset::AcceptLoglikes(), IvectorExtractorUtteranceStats::AccStats(), Fmpe::AccStats(), OnlineIvectorEstimationStats::AccStats(), IvectorExtractorStats::AccStatsForUtterance(), KlHmm::Accumulate(), FmpeStats::AccumulateChecks(), kaldi::AccumulateTreeStats(), BatchedXvectorComputer::AddChunkToBatch(), MatrixBase< float >::AddCols(), VectorBase< float >::AddColSumMat(), VectorBase< float >::AddDiagMat2(), VectorBase< float >::AddDiagMatMat(), MatrixBase< float >::AddDiagVecMat(), SpMatrix< float >::AddMat2(), SpMatrix< float >::AddMat2Sp(), SpMatrix< float >::AddMat2Vec(), CuMatrixBase< float >::AddMatBlocks(), MatrixBase< float >::AddMatDiagVec(), MatrixBase< float >::AddMatMatElements(), MatrixBase< float >::AddMatSmat(), VectorBase< float >::AddMatSvec(), VectorBase< float >::AddMatVec(), LdaEstimate::AddMeanOffset(), kaldi::AddOuterProductPlusMinus(), MatrixBase< float >::AddRows(), VectorBase< float >::AddRowSumMat(), PldaStats::AddSamples(), SpMatrix< float >::AddSmat2Sp(), MatrixBase< float >::AddSmatMat(), SparseMatrix< float >::AddToMat(), MatrixBase< float >::AddToRows(), DecodableNnetLoopedOnlineBase::AdvanceChunk(), DecodableNnetSimpleLooped::AdvanceChunk(), kaldi::nnet2::AppendDiscriminativeExamples(), OnlineDeltaInput::AppendFrames(), kaldi::AppendPostToFeats(), kaldi::AppendVectorToFeats(), kaldi::nnet3::ApplyAffineTransform(), kaldi::ApplyAffineTransform(), Fmpe::ApplyC(), kaldi::ApplyCmvn(), kaldi::ApplyCmvnReverse(), Fmpe::ApplyContext(), Fmpe::ApplyContextReverse(), kaldi::ApplyFeatureTransformToStats(), ApplyFmllrXform(), kaldi::ApplyModelTransformToStats(), kaldi::ApplyPca(), Sgmm2Project::ApplyProjection(), Plda::ApplyTransform(), kaldi::AssertEqual(), kaldi::AssertSameDim(), kaldi::nnet2::AverageConstPart(), MleAmSgmm2Accs::Check(), OnlineIvectorExtractionInfo::Check(), IvectorExtractorStats::CheckDims(), kaldi::ComposeTransforms(), OnlineMatrixInput::Compute(), OnlineCmnInput::Compute(), OnlineLdaInput::Compute(), OnlineDeltaInput::Compute(), kaldi::ComputeAmGmmFeatureDeriv(), kaldi::ComputeDctMatrix(), kaldi::ComputeDeltas(), Fmpe::ComputeFeatures(), kaldi::ComputeFmllrLogDet(), kaldi::ComputeFmllrMatrixDiagGmmOffset(), NnetUpdater::ComputeForMinibatch(), kaldi::ComputeGconsts(), CompressedMatrix::ComputeGlobalHeader(), OnlineCmnInput::ComputeInternal(), kaldi::ComputeLdaTransform(), kaldi::ComputePca(), Sgmm2Project::ComputeProjection(), kaldi::ComputeShiftedDeltas(), Fmpe::ComputeStddevs(), LinearVtln::ComputeTransform(), BasisFmllrEstimate::ComputeTransform(), VectorBase< float >::CopyColFromMat(), MatrixBase< float >::CopyCols(), VectorBase< float >::CopyColsFromMat(), VectorBase< float >::CopyDiagFromMat(), CompressedAffineXformStats::CopyFromAffineXformStats(), DiagGmm::CopyFromDiagGmm(), TpMatrix< float >::CopyFromMat(), SpMatrix< float >::CopyFromMat(), CompressedMatrix::CopyFromMat(), MatrixBase< float >::CopyFromMat(), CuMatrixBase< float >::CopyFromMat(), VectorBase< float >::CopyRowFromMat(), MatrixBase< float >::CopyRows(), CuVectorBase< float >::CopyRowsFromMat(), VectorBase< float >::CopyRowsFromMat(), DiagGmmNormal::CopyToDiagGmm(), FullGmmNormal::CopyToFullGmm(), CompressedMatrix::CopyToMat(), SparseMatrix< float >::CopyToMat(), CuMatrixBase< float >::CopyToMat(), kaldi::cu::CpuBackpropLstmNonlinearity(), kaldi::cu::CpuComputeLstmNonlinearity(), kaldi::CreateEigenvalueMatrix(), CuMatrix< float >::CuMatrix(), DecodableMatrixMapped::DecodableMatrixMapped(), DecodableMatrixScaledMapped::DecodableMatrixScaledMapped(), NnetBatchDecoder::Decode(), OnlineMatrixInput::Dim(), FullGmm::Dim(), DiagGmmNormal::Dim(), DiagGmm::Dim(), MatrixBase< float >::DivElements(), DiscriminativeExampleSplitter::DoExcise(), LogisticRegression::DoStep(), SpMatrix< float >::Eig(), EigenvalueDecomposition< Real >::EigenvalueDecomposition(), FeatureTransformEstimateMulti::Estimate(), FeatureTransformEstimate::EstimateInternal(), FeatureTransformEstimateMulti::EstimateTransformPart(), kaldi::EstPca(), OnlineIvectorExtractionInfo::ExpectedFeatureDim(), kaldi::ExtractObjectRange(), kaldi::ExtractRowRangeWithPadding(), kaldi::FakeStatsForSomeDims(), kaldi::FilterMatrixRows(), IvectorExtractorStats::FlushCache(), kaldi::FmllrInnerUpdate(), FmllrRawAccs::FmllrRawAccs(), DiagGmm::GaussianSelection(), kaldi::GetFeatDeriv(), kaldi::GetFeatureMeanAndVariance(), OnlineTransform::GetFrame(), OnlineTransform::GetFrames(), NnetDiscriminativeUpdater::GetInputFeatures(), LogisticRegression::GetLogPosteriors(), LogisticRegression::GetObjfAndGrad(), IvectorExtractorStats::GetOrthogonalIvectorTransform(), LinearVtln::GetTransform(), RegtreeMllrDiagGmm::GetTransformedMeans(), EigenvalueDecomposition< Real >::GetV(), MatrixBase< float >::GroupMax(), MatrixBase< float >::GroupMaxDeriv(), MatrixBase< float >::GroupPnorm(), MatrixBase< float >::GroupPnormDeriv(), AmSgmm2::IncreasePhoneSpaceDim(), AmSgmm2::IncreaseSpkSpaceDim(), kaldi::IncreaseTransformDimension(), OnlinePreconditionerSimple::Init(), OnlineNaturalGradientSimple::Init(), OnlineFeaturePipeline::Init(), kaldi::InitGmmFromRandomFrames(), AmSgmm2::InitializeMw(), InitRand(), kaldi::InitRand(), kaldi::InitRandNonsingular(), PitchInterpolator::InitValues(), kaldi::LatticeAcousticRescore(), kaldi::nnet2::LatticeToDiscriminativeExample(), OnlineIvectorExtractorAdaptationState::LimitFrames(), AffineComponent::LimitRank(), DecodableMatrixScaled::LogLikelihood(), AmSgmm2::LogLikelihood(), DiagGmm::LogLikelihoods(), main(), Matrix< BaseFloat >::Matrix(), MatrixBase< float >::Max(), kaldi::nnet3::MergeTaskOutput(), MatrixBase< float >::Min(), MatrixBase< float >::MinSingularValue(), LogisticRegression::MixUp(), kaldi::nnet1::MomentStatistics(), MatrixBase< float >::MulElements(), MatrixBase< float >::MulRowsGroupMat(), kaldi::NonOrthogonality(), DecodableMatrixScaled::NumIndices(), OnlineLdaInput::OnlineLdaInput(), OnlineTransform::OnlineTransform(), CuMatrix< float >::operator=(), Matrix< BaseFloat >::operator=(), MatrixBase< float >::OrthogonalizeRows(), DiscriminativeExampleSplitter::OutputOneSplit(), kaldi::nnet3::PerturbImage(), kaldi::PlaceNansInGaps(), OnlinePreconditionerSimple::PreconditionDirectionsCpu(), OnlineNaturalGradientSimple::PreconditionDirectionsCpu(), DeltaFeatures::Process(), ShiftedDeltaFeatures::Process(), kaldi::nnet2::ProcessFile(), kaldi::nnet3::ProcessFile(), Sgmm2Project::ProjectVariance(), NnetDiscriminativeUpdater::Propagate(), KlHmm::PropagateFnc(), kaldi::QrInternal(), kaldi::QrStep(), FullGmmNormal::Rand(), kaldi::unittest::RandDiagGaussFeatures(), kaldi::RandFullCova(), kaldi::unittest::RandFullGaussFeatures(), kaldi::RandZeroToOneMatrix(), AffineXformStats::Read(), FullGmm::Read(), MatrixBase< float >::Read(), Matrix< BaseFloat >::Read(), kaldi::ReadData(), KlHmm::ReadData(), kaldi::ReadHtk(), kaldi::cu::RegularizeL1(), ArbitraryResample::Resample(), FullGmmNormal::Resize(), FullGmm::Resize(), DiagGmmNormal::Resize(), DiagGmm::Resize(), Sgmm2PerFrameDerivedVars::Resize(), kaldi::ReverseFrames(), MatrixBase< float >::Row(), kaldi::SameDim(), LogisticRegression::ScalePriors(), FullGmm::SetInvCovarsAndMeans(), FullGmm::SetInvCovarsAndMeansInvCovars(), DiagGmm::SetInvVars(), DiagGmm::SetInvVarsAndMeans(), LinearTransform::SetLinearity(), MatrixBase< float >::SetMatMatDivMat(), FullGmm::SetMeans(), DiagGmm::SetMeans(), KlHmm::SetStats(), LinearVtln::SetTransform(), LogisticRegression::SetWeights(), CuMatrixBase< float >::SetZeroAboveDiag(), kaldi::SlidingWindowCmn(), kaldi::SlidingWindowCmnInternal(), OnlineCmvn::SmoothOnlineCmvnStats(), kaldi::SolveDoubleQuadraticMatrixProblem(), kaldi::SolveQuadraticMatrixProblem(), kaldi::SortSvd(), kaldi::cu::Splice(), kaldi::SpliceFrames(), OnlineLdaInput::SpliceFrames(), NnetBatchComputer::SplitUtteranceIntoTasks(), SubVector< Real >::SubVector(), kaldi::TestCuFindRowMaxId(), kaldi::TestFmpe(), kaldi::TestIvectorExtraction(), kaldi::TestOnlineAppendFeature(), kaldi::TestOnlineLdaInput(), kaldi::TestOnlineTransform(), SpMatrix< float >::TopEigs(), kaldi::TraceMatMat(), kaldi::TraceMatMatMat(), kaldi::TraceMatMatMatMat(), kaldi::TraceMatSmat(), kaldi::TraceMatSpMat(), kaldi::TraceMatSpMatSp(), kaldi::TraceSpMat(), LogisticRegression::Train(), LogisticRegression::TrainParameters(), SpMatrix< float >::Tridiagonalize(), kaldi::TypeOneUsage(), kaldi::TypeOneUsageAverage(), kaldi::TypeThreeUsage(), kaldi::TypeTwoUsage(), kaldi::UnitTestAddVecToCols(), kaldi::UnitTestAddVecToRows(), UnitTestCompareWithDeltaFeatures(), kaldi::UnitTestCuDiffNormalizePerRow(), kaldi::UnitTestCuDiffSigmoid(), kaldi::UnitTestCuDiffTanh(), kaldi::UnitTestCuFindRowMaxId(), kaldi::UnitTestCuMathNormalizePerRow(), kaldi::UnitTestCuMathNormalizePerRow_v2(), kaldi::UnitTestCuMatrixHeaviside(), kaldi::UnitTestCuSigmoid(), kaldi::UnitTestCuTanh(), kaldi::UnitTestDelay(), UnitTestEndEffects(), UnitTestHTKCompare1(), UnitTestHTKCompare2(), UnitTestHTKCompare3(), UnitTestHTKCompare4(), UnitTestHTKCompare5(), UnitTestHTKCompare6(), UnitTestParams(), kaldi::UnitTestRangesMatrix(), kaldi::UnitTestSimple(), kaldi::UnitTestSnipEdges(), kaldi::UnitTestSvdNodestroy(), kaldi::UnitTestTrain(), kaldi::UnitTestTransposeScatter(), MlltAccs::Update(), FmllrRawAccs::Update(), FmllrSgmm2Accs::Update(), Fmpe::Update(), kaldi::nnet2::UpdateHash(), IvectorExtractorStats::UpdatePrior(), UpdateWClass::UpdateWClass(), kaldi::VecMatVec(), AccumDiagGmm::Write(), SphinxMatrixHolder< kFeatDim >::Write(), kaldi::nnet3::WriteExamples(), kaldi::WriteHtk(), and kaldi::WriteSphinx().
|
inline |
Returns number of rows (or zero for empty matrix).
Definition at line 64 of file kaldi-matrix.h.
Referenced by kaldi::AccCmvnStats(), kaldi::AccCmvnStatsForPair(), kaldi::AccCmvnStatsWrapper(), DecodableMatrixMappedOffset::AcceptLoglikes(), BatchedXvectorComputer::AcceptUtterance(), CovarianceStats::AccStats(), IvectorExtractorUtteranceStats::AccStats(), Fmpe::AccStats(), IvectorExtractorStats::AccStatsForUtterance(), KlHmm::Accumulate(), FmpeStats::AccumulateChecks(), kaldi::AccumulateForUtterance(), kaldi::AccumulateTreeStats(), BatchedXvectorComputer::AddChunkToBatch(), MatrixBase< float >::AddCols(), VectorBase< float >::AddColSumMat(), MatrixRandomizer::AddData(), VectorBase< float >::AddDiagMat2(), VectorBase< float >::AddDiagMatMat(), MatrixBase< float >::AddDiagVecMat(), SpMatrix< float >::AddMat2(), SpMatrix< float >::AddMat2Sp(), SpMatrix< float >::AddMat2Vec(), CuMatrixBase< float >::AddMatBlocks(), MatrixBase< float >::AddMatDiagVec(), MatrixBase< float >::AddMatMatElements(), MatrixBase< float >::AddMatSmat(), VectorBase< float >::AddMatSvec(), VectorBase< float >::AddMatVec(), LdaEstimate::AddMeanOffset(), kaldi::AddOuterProductPlusMinus(), MatrixBase< float >::AddRows(), VectorBase< float >::AddRowSumMat(), PldaStats::AddSamples(), SpMatrix< float >::AddSmat2Sp(), MatrixBase< float >::AddSmatMat(), kaldi::AddToConfusionMatrix(), CuMatrixBase< float >::AddToElements(), SparseMatrix< float >::AddToMat(), DecodableNnetLoopedOnlineBase::AdvanceChunk(), DecodableNnetSimpleLooped::AdvanceChunk(), SingleUtteranceGmmDecoder::AdvanceDecoding(), AgglomerativeClusterer::AgglomerativeClusterer(), kaldi::nnet2::AppendDiscriminativeExamples(), OnlineDeltaInput::AppendFrames(), kaldi::AppendPostToFeats(), kaldi::AppendVectorToFeats(), kaldi::nnet3::ApplyAffineTransform(), kaldi::ApplyAffineTransform(), Fmpe::ApplyC(), kaldi::ApplyCmvn(), kaldi::ApplyCmvnReverse(), Fmpe::ApplyContext(), Fmpe::ApplyContextReverse(), kaldi::ApplyFeatureTransformToStats(), ApplyFmllrXform(), kaldi::ApplyHessianXformToGradient(), kaldi::ApplyInvHessianXformToChange(), kaldi::ApplyInvPreXformToChange(), kaldi::ApplyModelTransformToStats(), kaldi::ApplyPca(), kaldi::ApplyPreXformToGradient(), Sgmm2Project::ApplyProjection(), Fmpe::ApplyProjection(), Fmpe::ApplyProjectionReverse(), kaldi::ApplySoftMaxPerRow(), Plda::ApplyTransform(), kaldi::AssertEqual(), kaldi::AssertSameDim(), kaldi::CalBasisFmllrStepSize(), MleAmSgmm2Accs::Check(), OnlineIvectorExtractionInfo::Check(), IvectorExtractorStats::CheckDims(), IvectorExtractorStats::CommitStatsForM(), kaldi::ComposeTransforms(), OnlineMatrixInput::Compute(), OnlineCmnInput::Compute(), OnlineCacheInput::Compute(), OnlineLdaInput::Compute(), OnlineDeltaInput::Compute(), OnlineFeInput< E >::Compute(), kaldi::ComputeAmGmmFeatureDeriv(), kaldi::ComputeDctMatrix(), kaldi::ComputeDeltas(), Fmpe::ComputeFeatures(), kaldi::ComputeFmllrLogDet(), kaldi::ComputeFmllrMatrixDiagGmmOffset(), DecodableNnet2Online::ComputeForFrame(), NnetUpdater::ComputeForMinibatch(), kaldi::ComputeGconsts(), CompressedMatrix::ComputeGlobalHeader(), OnlineCmnInput::ComputeInternal(), kaldi::ComputeLdaTransform(), OnlineLdaInput::ComputeNextRemainder(), kaldi::ComputePca(), Sgmm2Project::ComputeProjection(), kaldi::ComputeShiftedDeltas(), Fmpe::ComputeStddevs(), LinearVtln::ComputeTransform(), BasisFmllrEstimate::ComputeTransform(), kaldi::ComputeVadEnergy(), kaldi::nnet3::time_height_convolution::ConvolveForwardSimple(), kaldi::cu::Copy(), VectorBase< float >::CopyColFromMat(), MatrixBase< float >::CopyCols(), VectorBase< float >::CopyColsFromMat(), VectorBase< float >::CopyDiagFromMat(), CompressedAffineXformStats::CopyFromAffineXformStats(), TpMatrix< float >::CopyFromMat(), SpMatrix< float >::CopyFromMat(), CompressedMatrix::CopyFromMat(), MatrixBase< float >::CopyFromMat(), CuMatrixBase< float >::CopyFromMat(), VectorBase< float >::CopyRowFromMat(), CuVectorBase< float >::CopyRowsFromMat(), VectorBase< float >::CopyRowsFromMat(), CompressedAffineXformStats::CopyToAffineXformStats(), CompressedMatrix::CopyToMat(), SparseMatrix< float >::CopyToMat(), CuMatrixBase< float >::CopyToMat(), GeneralMatrix::CopyToMat(), kaldi::cu::CpuBackpropLstmNonlinearity(), kaldi::cu::CpuComputeLstmNonlinearity(), kaldi::CreateEigenvalueMatrix(), CuMatrix< float >::CuMatrix(), DecodableAmSgmm2::DecodableAmSgmm2(), OnlineDeltaInput::DeltaComputation(), MatrixBase< float >::DivElements(), DecodableNnetSimple::DoNnetComputation(), LogisticRegression::DoStep(), SpMatrix< float >::Eig(), EigenvalueDecomposition< Real >::EigenvalueDecomposition(), DecodableNnetLoopedOnlineBase::EnsureFrameIsComputed(), DecodableNnetSimple::EnsureFrameIsComputed(), SingleUtteranceGmmDecoder::EstimateFmllr(), FeatureTransformEstimate::EstimateInternal(), kaldi::EstimateIvectorsOnline(), kaldi::EstPca(), kaldi::ExtractObjectRange(), kaldi::ExtractRowRangeWithPadding(), kaldi::FakeStatsForSomeDims(), kaldi::FilterMatrixRows(), kaldi::FmllrInnerUpdate(), FmllrRawAccs::FmllrRawAccs(), DiagGmm::GaussianSelection(), kaldi::GetFeatDeriv(), kaldi::GetFeatureMeanAndVariance(), OnlineCmvn::GetFrame(), OnlineFeatureInterface::GetFrames(), OnlineTransform::GetFrames(), kaldi::GetGmmLike(), NnetDiscriminativeUpdater::GetInputFeatures(), LogisticRegression::GetLogPosteriors(), OnlineFeatureMatrix::GetNextFeatures(), LogisticRegression::GetObjfAndGrad(), IvectorExtractorStats::GetOrthogonalIvectorTransform(), DecodableNnetSimpleLooped::GetOutputForFrame(), OnlineCmvn::GetState(), LinearVtln::GetTransform(), RegtreeMllrDiagGmm::GetTransformedMeans(), EigenvalueDecomposition< Real >::GetV(), MatrixBase< float >::GroupMax(), MatrixBase< float >::GroupMaxDeriv(), MatrixBase< float >::GroupPnorm(), MatrixBase< float >::GroupPnormDeriv(), AmSgmm2::IncreasePhoneSpaceDim(), AmSgmm2::IncreaseSpkSpaceDim(), kaldi::IncreaseTransformDimension(), OnlineNaturalGradientSimple::Init(), OnlinePreconditionerSimple::Init(), OnlineFeaturePipeline::Init(), kaldi::InitGmmFromRandomFrames(), AmSgmm2::InitializeMw(), InitRand(), kaldi::InitRand(), kaldi::InitRandNonsingular(), PitchInterpolator::InitValues(), kaldi::LatticeAcousticRescore(), kaldi::nnet1::LatticeAcousticRescore(), kaldi::nnet2::LatticeToDiscriminativeExample(), OnlineIvectorExtractorAdaptationState::LimitFrames(), AffineComponent::LimitRank(), kaldi::LinearlyInterpolatePitch(), DecodableNnet2Online::LogLikelihood(), DecodableMatrixScaled::LogLikelihood(), DiagGmm::LogLikelihoods(), CuMatrixBase< float >::LogSoftMaxPerRow(), main(), Matrix< BaseFloat >::Matrix(), MatrixBase< float >::Max(), MatrixBase< float >::Min(), MatrixBase< float >::MinSingularValue(), LogisticRegression::MixUp(), kaldi::nnet1::MomentStatistics(), MatrixBase< float >::MulElements(), MatrixBase< float >::MulRowsGroupMat(), NnetDiscriminativeUpdater::NnetDiscriminativeUpdater(), NnetIo::NnetIo(), kaldi::NonOrthogonality(), DecodableAmDiagGmmRegtreeFmllr::NumFramesReady(), DecodableMatrixScaledMapped::NumFramesReady(), DecodableAmDiagGmmUnmapped::NumFramesReady(), DecodableAmSgmm2::NumFramesReady(), DecodableAmNnet::NumFramesReady(), DecodableAmDiagGmmRegtreeMllr::NumFramesReady(), DecodableAmNnetParallel::NumFramesReady(), DecodableMatrixScaled::NumFramesReady(), OnlineLdaInput::OnlineLdaInput(), OnlineTransform::OnlineTransform(), LimitRankClass::operator()(), CuMatrix< float >::operator=(), Matrix< BaseFloat >::operator=(), MatrixBase< float >::OrthogonalizeRows(), kaldi::nnet3::PerturbImage(), kaldi::PlaceNansInGaps(), OnlineNaturalGradientSimple::PreconditionDirectionsCpu(), OnlinePreconditionerSimple::PreconditionDirectionsCpu(), DeltaFeatures::Process(), ShiftedDeltaFeatures::Process(), kaldi::nnet2::ProcessFile(), kaldi::nnet3::ProcessFile(), kaldi::ProcessPovFeatures(), kaldi::ProcessUtterance(), Sgmm2Project::ProjectVariance(), NnetDiscriminativeUpdater::Propagate(), KlHmm::PropagateFnc(), SpMatrix< float >::Qr(), FullGmmNormal::Rand(), kaldi::unittest::RandDiagGaussFeatures(), kaldi::RandFullCova(), kaldi::unittest::RandFullGaussFeatures(), kaldi::RandZeroToOneMatrix(), AffineXformStats::Read(), LogisticRegression::Read(), MatrixBuffer::Read(), MatrixBase< float >::Read(), Matrix< BaseFloat >::Read(), kaldi::ReadData(), KlHmm::ReadData(), kaldi::ReadHtk(), kaldi::cu::RegularizeL1(), ArbitraryResample::Resample(), SingleUtteranceGmmDecoder::RescoringIsNeeded(), FullGmmNormal::Resize(), FullGmm::Resize(), DiagGmmNormal::Resize(), DiagGmm::Resize(), Sgmm2PerFrameDerivedVars::Resize(), kaldi::ReverseFrames(), DiscriminativeExampleSplitter::RightContext(), kaldi::nnet3::RunNnetComputation(), SingleUtteranceNnet2DecoderThreaded::RunNnetEvaluationInternal(), kaldi::RunPerSpeaker(), kaldi::SameDim(), LogisticRegression::ScalePriors(), FullGmm::SetInvCovarsAndMeans(), FullGmm::SetInvCovarsAndMeansInvCovars(), DiagGmm::SetInvVars(), DiagGmm::SetInvVarsAndMeans(), LinearTransform::SetLinearity(), MatrixBase< float >::SetMatMatDivMat(), FullGmm::SetMeans(), DiagGmm::SetMeans(), KlHmm::SetStats(), kaldi::SetToMovingAverage(), LinearVtln::SetTransform(), OnlineFeaturePipeline::SetTransform(), LogisticRegression::SetWeights(), CuMatrixBase< float >::SetZeroAboveDiag(), kaldi::ShiftFeatureMatrix(), kaldi::SlidingWindowCmn(), kaldi::SlidingWindowCmnInternal(), OnlineCmvn::SmoothOnlineCmvnStats(), CuMatrixBase< float >::SoftMaxPerRow(), kaldi::SolveDoubleQuadraticMatrixProblem(), kaldi::SolveQuadraticMatrixProblem(), kaldi::SortSvd(), SparseMatrix< float >::SparseMatrix(), kaldi::cu::Splice(), kaldi::SpliceFrames(), OnlineLdaInput::SpliceFrames(), NnetBatchComputer::SplitUtteranceIntoTasks(), SpMatrix< float >::SpMatrix(), kaldi::SubtractMovingAverage(), kaldi::TakeLogOfPitch(), test_flags_driven_update(), test_io(), TestAmDiagGmmAccsIO(), TestComponentAcc(), kaldi::TestCuFindRowMaxId(), kaldi::TestFmpe(), kaldi::TestIvectorExtraction(), TestMllrAccsIO(), kaldi::TestOnlineAppendFeature(), kaldi::TestOnlineCmnInput(), kaldi::TestOnlineLdaInput(), kaldi::TestOnlineMfcc(), kaldi::TestOnlinePlp(), kaldi::TestOnlineTransform(), TestSgmm2AccsIO(), TestSgmm2FmllrAccsIO(), TestSgmm2FmllrSubspace(), TestSgmm2PreXform(), TestXformMean(), SpMatrix< float >::TopEigs(), kaldi::TraceMatMat(), kaldi::TraceMatMatMat(), kaldi::TraceMatMatMatMat(), kaldi::TraceMatSmat(), kaldi::TraceMatSpMat(), kaldi::TraceMatSpMatSp(), kaldi::TraceSpMat(), LogisticRegression::Train(), kaldi::TrainOneIter(), LogisticRegression::TrainParameters(), kaldi::TransformIvectors(), OnlineLdaInput::TransformToOutput(), SpMatrix< float >::Tridiagonalize(), kaldi::TypeOneUsage(), kaldi::TypeOneUsageAverage(), kaldi::TypeThreeUsage(), kaldi::TypeTwoUsage(), kaldi::UnitTestAddVecToCols(), kaldi::UnitTestAddVecToRows(), UnitTestCompareWithDeltaFeatures(), kaldi::UnitTestComputeGPE(), kaldi::UnitTestCuDiffLogSoftmax(), kaldi::UnitTestCuDiffNormalizePerRow(), kaldi::UnitTestCuDiffSigmoid(), kaldi::UnitTestCuDiffSoftmax(), kaldi::UnitTestCuDiffTanh(), kaldi::UnitTestCuDiffXent(), kaldi::UnitTestCuFindRowMaxId(), kaldi::UnitTestCuLogSoftmax(), kaldi::UnitTestCuMathNormalizePerRow(), kaldi::UnitTestCuMathNormalizePerRow_v2(), kaldi::UnitTestCuMatrixHeaviside(), kaldi::UnitTestCuSigmoid(), kaldi::UnitTestCuSoftmax(), kaldi::UnitTestCuTanh(), UnitTestEndEffects(), UnitTestEstimateFullGmm(), kaldi::UnitTestGeneralMatrix(), UnitTestHTKCompare1(), UnitTestHTKCompare2(), UnitTestHTKCompare3(), UnitTestHTKCompare4(), UnitTestHTKCompare5(), UnitTestHTKCompare6(), kaldi::nnet2::UnitTestNnetComputeChunked(), UnitTestParams(), kaldi::UnitTestPosteriors(), kaldi::UnitTestRangesMatrix(), kaldi::UnitTestSimple(), kaldi::UnitTestSnipEdges(), kaldi::UnitTestSvdNodestroy(), kaldi::UnitTestSymAddMat2(), kaldi::UnitTestTrain(), kaldi::UnitTestTransposeScatter(), MlltAccs::Update(), FmllrRawAccs::Update(), FmllrSgmm2Accs::Update(), Fmpe::Update(), kaldi::nnet2::UpdateHash(), IvectorExtractorStats::UpdatePrior(), UpdateWClass::UpdateWClass(), kaldi::VecMatVec(), AccumDiagGmm::Write(), MleAmSgmm2Accs::Write(), SphinxMatrixHolder< kFeatDim >::Write(), kaldi::nnet3::WriteExamples(), kaldi::WriteHtk(), and kaldi::WriteSphinx().
|
inline |
Indexing operator, non-const (only checks sizes if compiled with -DKALDI_PARANOID)
Definition at line 102 of file kaldi-matrix.h.
|
inline |
Indexing operator, const (only checks sizes if compiled with -DKALDI_PARANOID)
Definition at line 115 of file kaldi-matrix.h.
void OrthogonalizeRows | ( | ) |
This function orthogonalizes the rows of a matrix using the Gram-Schmidt process.
It is only applicable if NumRows() <= NumCols(). It will use random number generation to fill in rows with something nonzero, in cases where the original matrix was of deficient row rank.
Definition at line 1948 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::AddTpTp(), kaldi::ComputePca(), OnlineNaturalGradient::ReorthogonalizeRt1(), and OnlinePreconditioner::ReorthogonalizeXt1().
void Pow | ( | const MatrixBase< Real > & | src, |
Real | power | ||
) |
Definition at line 2128 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ApplyPow(), and MatrixBase< float >::MinSingularValue().
void PowAbs | ( | const MatrixBase< Real > & | src, |
Real | power, | ||
bool | include_sign = false |
||
) |
Apply power to the absolute value of each element.
If include_sign is true, the result will be multiplied with the sign of the input value. If the power is negative and the input to the power is zero, The output will be set zero. If include_sign is true, it will multiply the result by the sign of the input.
Definition at line 2142 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ApplyPowAbs(), and MatrixBase< float >::MinSingularValue().
bool Power | ( | Real | pow | ) |
The Power method attempts to take the matrix to a power using a method that works in general for fractional and negative powers.
The input matrix must be invertible and have reasonable condition (or we don't guarantee the results. The method is based on the eigenvalue decomposition. It will return false and leave the matrix unchanged, if at entry the matrix had real negative eigenvalues (or if it had zero eigenvalues and the power was negative).
Definition at line 2232 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ApplyLog(), and kaldi::UnitTestNonsymmetricPower().
|
inline |
Return a sub-part of matrix.
Definition at line 202 of file kaldi-matrix.h.
Referenced by kaldi::nnet2::AppendDiscriminativeExamples(), kaldi::AppendFeats(), OnlineDeltaInput::AppendFrames(), kaldi::ApplyInvPreXformToChange(), kaldi::ApplyPreXformToGradient(), Fmpe::ApplyProjection(), kaldi::nnet2::AverageConstPart(), OnlineMatrixInput::Compute(), BasisFmllrEstimate::ComputeAmDiagPrecond(), kaldi::ComputeFmllrMatrixDiagGmmDiagonal(), AmSgmm2::ComputeFmllrPreXform(), Sgmm2Project::ComputeProjection(), LinearVtln::ComputeTransform(), BasisFmllrEstimate::ComputeTransform(), kaldi::ConcatFeats(), OnlineDeltaInput::DeltaComputation(), LdaEstimate::Estimate(), FeatureTransformEstimateMulti::Estimate(), FeatureTransformEstimate::EstimateInternal(), kaldi::ExtractObjectRange(), IvectorExtractorStats::FlushCache(), kaldi::FmllrAuxfGradient(), FmllrDiagGmmAccs::FmllrDiagGmmAccs(), kaldi::FmllrInnerUpdate(), FmllrSgmm2Accs::FmllrObjGradient(), FmllrRawAccs::FmllrRawAccs(), OnlineCacheInput::GetCachedData(), AmSgmm2::IncreasePhoneSpaceDim(), AmSgmm2::IncreaseSpkSpaceDim(), AmSgmm2::InitializeMw(), AmSgmm2::InitializeNu(), kaldi::nnet2::LatticeToDiscriminativeExample(), main(), kaldi::MergeFullGmm(), SoftmaxComponent::MixUp(), OnlineLdaInput::OnlineLdaInput(), OnlineTransform::OnlineTransform(), DiscriminativeExampleSplitter::OutputOneSplit(), Matrix< BaseFloat >::Resize(), FullGmm::Split(), DiagGmm::Split(), SpMatrix< float >::TopEigs(), UnitTestFullGmm(), and kaldi::UnitTestRange().
stream read.
Use instead of stream<<*this, if you want to add to existing contents.
Definition at line 1423 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::AddTpTp(), Matrix< BaseFloat >::Matrix(), and kaldi::operator>>().
|
inline |
Return specific row of matrix [const].
Definition at line 188 of file kaldi-matrix.h.
Referenced by kaldi::AccCmvnStats(), kaldi::AccCmvnStatsForPair(), OnlineCmnInput::AcceptFrame(), OnlinePitchFeatureImpl::AcceptWaveform(), OnlineIvectorEstimationStats::AccStats(), kaldi::AccStatsForUtterance(), BasisFmllrAccus::AccuGradientScatter(), LdaEstimate::Accumulate(), KlHmm::Accumulate(), AccumFullGmm::AccumulateForComponent(), AccumDiagGmm::AccumulateForComponent(), RegtreeMllrDiagGmmAccs::AccumulateForGaussian(), RegtreeMllrDiagGmmAccs::AccumulateForGmm(), kaldi::AccumulateForUtterance(), AccumFullGmm::AccumulateFromPosteriors(), FmllrRawAccs::AccumulateFromPosteriors(), MleAmSgmm2Accs::AccumulateFromPosteriors(), FmllrDiagGmmAccs::AccumulateFromPosteriorsPreselect(), kaldi::AccumulateTreeStats(), AccumDiagGmm::AddStatsForComponent(), kaldi::ApplyCmvn(), kaldi::ApplyCmvnReverse(), Fmpe::ApplyContext(), Fmpe::ApplyContextReverse(), Fmpe::ApplyProjection(), Fmpe::ApplyProjectionReverse(), kaldi::ApplySoftMaxPerRow(), kaldi::CalBasisFmllrStepSize(), kaldi::ClusterGaussiansToUbm(), IvectorExtractorStats::CommitStatsForM(), FullGmm::ComponentLogLikelihood(), DiagGmm::ComponentLogLikelihood(), AmSgmm2::ComponentLogLikes(), OnlineLdaInput::Compute(), OnlineDeltaInput::Compute(), BasisFmllrEstimate::ComputeAmDiagPrecond(), Fmpe::ComputeC(), IvectorExtractor::ComputeDerivedVars(), kaldi::ComputeFeatureNormalizingTransform(), AmSgmm2::ComputeFmllrPreXform(), FullGmm::ComputeGconsts(), Sgmm2Project::ComputeLdaStats(), kaldi::ComputeLdaTransform(), kaldi::ComputeMllrMatrix(), OnlineLdaInput::ComputeNextRemainder(), AmSgmm2::ComputeNormalizersInternal(), kaldi::ComputePca(), AmSgmm2::ComputePerFrameVars(), AmSgmm2::ComputePerSpkDerivedVars(), EbwAmSgmm2Updater::ComputePhoneVecStats(), ComputeScores(), OnlineCmvn::ComputeStatsForFrame(), BasisFmllrEstimate::ComputeTransform(), FmllrRawAccs::ConvertToSimpleStats(), FullGmmNormal::CopyFromFullGmm(), DiagGmm::CopyFromFullGmm(), MatrixBase< float >::CopyFromMat(), FullGmmNormal::CopyToFullGmm(), DiagGmm::DiagGmm(), kaldi::DiagGmmToStats(), LdaEstimate::Estimate(), BasisFmllrEstimate::EstimateFmllrBasis(), FeatureTransformEstimate::EstimateInternal(), kaldi::EstimateIvectorsOnline(), kaldi::FmllrAuxfGradient(), kaldi::FmllrAuxFuncDiagGmm(), FmllrDiagGmmAccs::FmllrDiagGmmAccs(), kaldi::FmllrInnerUpdate(), GaussClusterable::GaussClusterable(), kaldi::GenRandStats(), IvectorExtractor::GetAcousticAuxfMean(), IvectorExtractor::GetAcousticAuxfVariance(), FullGmm::GetComponentMean(), FullGmm::GetCovarsAndMeans(), kaldi::GetFeatureMeanAndVariance(), OnlineCacheFeature::GetFrames(), kaldi::GetGmmLike(), GetLogLikeTest(), LogisticRegression::GetLogPosteriors(), FullGmm::GetMeans(), LogisticRegression::GetObjfAndGrad(), DecodableNnetSimpleLooped::GetOutputForFrame(), OnlineCmvn::GetState(), AmSgmm2::GetSubstateSpeakerMean(), RegtreeMllrDiagGmm::GetTransformedMeans(), MatrixBase< float >::GroupPnorm(), kaldi::InitGmmFromRandomFrames(), IvectorExtractor::IvectorExtractor(), kaldi::nnet2::LatticeToDiscriminativeExample(), FullGmm::LogLikelihoodsPreselect(), DiagGmm::LogLikelihoodsPreselect(), DecodableAmDiagGmmRegtreeFmllr::LogLikelihoodZeroBased(), DecodableAmDiagGmmUnmapped::LogLikelihoodZeroBased(), DecodableAmDiagGmmRegtreeMllr::LogLikelihoodZeroBased(), CuMatrixBase< float >::LogSoftMaxPerRow(), main(), kaldi::MapDiagGmmUpdate(), FullGmm::Merge(), DiagGmm::Merge(), FullGmm::MergePreselect(), LogisticRegression::MixUp(), kaldi::MleDiagGmmUpdate(), kaldi::MleFullGmmUpdate(), kaldi::MllrAuxFunction(), MatrixBase< float >::OrthogonalizeRows(), OnlineCmnInput::OutputFrame(), FullGmm::Perturb(), DeltaFeatures::Process(), ShiftedDeltaFeatures::Process(), kaldi::nnet2::ProcessFile(), kaldi::nnet3::ProcessFile(), FullGmmNormal::Rand(), kaldi::unittest::RandDiagGaussFeatures(), kaldi::unittest::RandFullGaussFeatures(), kaldi::cu::Randomize(), AccumFullGmm::Read(), LdaEstimate::Read(), MleAmSgmm2Updater::RenormalizeV(), DiagGmm::SetComponentInvVar(), FullGmm::SetInvCovars(), FullGmm::SetInvCovarsAndMeans(), FullGmm::SetMeans(), kaldi::ShiftFeatureMatrix(), AccumDiagGmm::SmoothWithAccum(), CuMatrixBase< float >::SoftMaxPerRow(), kaldi::SolveDoubleQuadraticMatrixProblem(), kaldi::SortSvd(), SparseMatrix< float >::SparseMatrix(), OnlineLdaInput::SpliceFrames(), FullGmm::Split(), DiagGmm::Split(), AmSgmm2::SplitSubstatesInGroup(), test_flags_driven_update(), test_io(), TestAmDiagGmmAccsIO(), TestComponentAcc(), kaldi::TestIvectorExtraction(), TestMllrAccsIO(), kaldi::TestOnlineCmnInput(), kaldi::TestOnlineFeatureMatrix(), kaldi::TestOnlineTransform(), TestSgmm2AccsIO(), TestSgmm2Fmllr(), TestSgmm2FmllrAccsIO(), TestSgmm2FmllrSubspace(), TestXformMean(), kaldi::TraceMatSmat(), kaldi::TransformIvectors(), kaldi::UnitTestAddDiagVecMat(), UnitTestArbitraryResample(), kaldi::UnitTestCompressedMatrix(), kaldi::UnitTestCuLogSoftmax(), kaldi::UnitTestCuMatrixApplyHeaviside(), kaldi::UnitTestCuMatrixApplyPow(), kaldi::UnitTestCuMatrixApplyPowAbs(), kaldi::UnitTestCuMatrixHeaviside(), kaldi::UnitTestCuSoftmax(), kaldi::UnitTestDeterminantSign(), UnitTestEstimateDiagGmm(), UnitTestEstimateFullGmm(), UnitTestEstimateLda(), UnitTestEstimateSgmm2(), UnitTestFullGmm(), UnitTestFullGmmEst(), kaldi::UnitTestGeneralMatrix(), UnitTestHTKCompare1(), UnitTestHTKCompare2(), UnitTestHTKCompare3(), UnitTestHTKCompare4(), UnitTestHTKCompare5(), UnitTestHTKCompare6(), UnitTestLinearResample(), UnitTestMleAmDiagGmm(), kaldi::UnitTestPosteriors(), UnitTestRegressionTree(), FmllrRawAccs::Update(), kaldi::UpdateEbwDiagGmm(), kaldi::nnet2::UpdateHash(), MleAmSgmm2Updater::UpdatePhoneVectorsInternal(), PldaUnsupervisedAdaptor::UpdatePlda(), OnlineIvectorFeature::UpdateStatsForFrames(), EbwAmSgmm2Updater::UpdateU(), MleAmSgmm2Updater::UpdateU(), IvectorExtractorStats::UpdateVariances(), EbwAmSgmm2Updater::UpdateW(), MleAmSgmm2Updater::UpdateW(), IvectorExtractorStats::UpdateWeight(), MleAmSgmm2Updater::UpdateWGetStats(), MleSgmm2SpeakerAccs::UpdateWithU(), AccumFullGmm::Write(), and LdaEstimate::Write().
|
inline |
Return specific row of matrix.
Definition at line 195 of file kaldi-matrix.h.
|
inline |
Returns pointer to data for one row (non-const)
Definition at line 87 of file kaldi-matrix.h.
Referenced by kaldi::AccCmvnStats(), VectorBase< float >::AddColSumMat(), SpMatrix< float >::AddMat2Sp(), MatrixBase< float >::AddRows(), MatrixBase< float >::AddSmatMat(), MatrixBase< float >::AddToRows(), kaldi::ApplyCmvn(), CompressedMatrix::CopyFromMat(), VectorBase< float >::CopyRowFromMat(), MatrixBase< float >::CopyRows(), CuVectorBase< float >::CopyRowsFromMat(), VectorBase< float >::CopyRowsFromMat(), CompressedMatrix::CopyToMat(), kaldi::cu::CpuComputeLstmNonlinearity(), MatrixBase< float >::GroupMax(), MatrixBase< float >::Max(), MatrixBase< float >::Min(), kaldi::PlaceNansInGaps(), kaldi::ReadHtk(), MatrixBase< float >::SoftHinge(), kaldi::cu::Splice(), SubVector< Real >::SubVector(), kaldi::UnitTestAddRows(), kaldi::UnitTestCopyRows(), kaldi::UnitTestSimpleForMat(), kaldi::WriteHtk(), and kaldi::WriteSphinx().
|
inline |
Returns pointer to data for one row (const)
Definition at line 94 of file kaldi-matrix.h.
|
inline |
Definition at line 209 of file kaldi-matrix.h.
Referenced by DecodableMatrixMappedOffset::AcceptLoglikes(), kaldi::ComputeAndProcessKaldiPitch(), kaldi::ComputeKaldiPitchFirstPass(), NnetBatchComputer::FormatOutputs(), kaldi::nnet3::MergeTaskOutput(), OnlineCmvn::SmoothOnlineCmvnStats(), and UnitTestMatrixRandomizer().
void Scale | ( | Real | alpha | ) |
Multiply each element with a scalar value.
Definition at line 1209 of file kaldi-matrix.cc.
Referenced by BasisFmllrAccus::AccuGradientScatter(), FmllrSgmm2Accs::Accumulate(), MleAmSgmm2Accs::Accumulate(), MleSgmm2SpeakerAccs::Accumulate(), kaldi::AccumulateForUtterance(), MatrixBase< float >::ColRange(), AmSgmm2::ComponentPosteriors(), DecodableAmNnetParallel::Compute(), MleAmSgmm2Updater::ComputeMPrior(), BasisFmllrEstimate::ComputeTransform(), kaldi::FmllrAuxfGradient(), FmllrSgmm2Accs::FmllrObjGradient(), kaldi::generate_features(), LogisticRegression::GetObjfAndGrad(), IvectorExtractor::IvectorExtractor(), OnlineIvectorExtractorAdaptationState::LimitFrames(), main(), DiagGmm::Merge(), LdaEstimate::Scale(), AccumFullGmm::Scale(), AccumDiagGmm::Scale(), kaldi::TypeOneUsage(), kaldi::TypeOneUsageAverage(), kaldi::TypeThreeUsage(), kaldi::UnitTestAddMatDiagVec(), kaldi::UnitTestAddMatMatElements(), kaldi::nnet2::UnitTestAffineComponent(), kaldi::nnet2::UnitTestAffineComponentPreconditioned(), kaldi::nnet2::UnitTestAffineComponentPreconditionedOnline(), kaldi::UnitTestCompressedMatrix(), kaldi::nnet2::UnitTestConvolutional1dComponent(), kaldi::UnitTestCuDiffLogSoftmax(), kaldi::UnitTestCuDiffNormalizePerRow(), kaldi::UnitTestCuLogSoftmax(), kaldi::UnitTestCuMathNormalizePerRow(), kaldi::UnitTestCuMathNormalizePerRow_v2(), kaldi::UnitTestCuMatrixScale(), kaldi::UnitTestCuSoftmax(), kaldi::UnitTestDeterminantSign(), UnitTestEstimateFullGmm(), kaldi::UnitTestIo(), kaldi::UnitTestIoCross(), kaldi::UnitTestNorm(), kaldi::UnitTestScale(), FmllrSgmm2Accs::Update(), and LstmNonlinearityComponent::Write().
void Set | ( | Real | value | ) |
Sets all elements to a specific value.
Definition at line 1339 of file kaldi-matrix.cc.
Referenced by LogisticRegression::GetLogPosteriors(), GeneralDropoutComponent::GetMemo(), main(), MatrixBase< float >::operator()(), DiagGmm::Resize(), kaldi::ResizeModel(), VectorClusterable::SetZero(), kaldi::UnitTestCuMatrixSet(), kaldi::nnet2::UnitTestPreconditionDirectionsOnline(), kaldi::nnet3::UnitTestPreconditionDirectionsOnline(), kaldi::UnitTestSvdBad(), and kaldi::UnitTestTridiagonalize().
void SetMatMatDivMat | ( | const MatrixBase< Real > & | A, |
const MatrixBase< Real > & | B, | ||
const MatrixBase< Real > & | C | ||
) |
*this = a * b / c (by element; when c = 0, *this = a)
o / i is either zero or "scale".
Just imagine the scale was 1.0. This is somehow true in
expectation; anyway, this case should basically never happen so it doesn't really matter.
Definition at line 189 of file kaldi-matrix.cc.
void SetRandn | ( | ) |
Sets to random values of a normal distribution.
Definition at line 1355 of file kaldi-matrix.cc.
Referenced by IvectorExtractorStats::CommitStatsForW(), kaldi::CuVectorUnitTestCopyDiagFromMat(), kaldi::generate_features(), kaldi::nnet3::GenerateSimpleNnetTrainingExample(), MatrixBase< float >::operator()(), rand_posdef_spmatrix(), kaldi::RandFullCova(), kaldi::unittest::RandPosdefSpMatrix(), RandPosdefSpMatrix(), kaldi::TestCuFindRowMaxId(), kaldi::TestOnlineCmnInput(), kaldi::TestOnlineFeatureMatrix(), kaldi::TestOnlineLdaInput(), kaldi::TestOnlineMatrixCacheFeature(), kaldi::TestOnlineMatrixInput(), kaldi::TestOnlineTransform(), kaldi::UnitTestAddColSumMatSpeed(), kaldi::UnitTestAddDiagMat2(), kaldi::UnitTestAddDiagMatMat(), kaldi::UnitTestAddDiagVecMat(), kaldi::UnitTestAddMat2(), kaldi::UnitTestAddMat2Sp(), kaldi::UnitTestAddMatSmat(), kaldi::UnitTestAddRows(), kaldi::UnitTestAddRowSumMatSpeed(), kaldi::UnitTestAddToRows(), kaldi::UnitTestAddVecToCols(), kaldi::UnitTestAddVecToColsSpeed(), kaldi::UnitTestAddVecToRows(), kaldi::UnitTestAddVecToRowsSpeed(), kaldi::UnitTestAddVecVec(), kaldi::nnet2::UnitTestAffineComponent(), kaldi::nnet2::UnitTestAffineComponentPreconditioned(), kaldi::nnet2::UnitTestAffineComponentPreconditionedOnline(), kaldi::UnitTestApplyExpSpecial(), kaldi::UnitTestBackpropLstmNonlinearity(), kaldi::UnitTestCheck(), kaldi::UnitTestCompressedMatrix(), kaldi::nnet2::UnitTestConvolutional1dComponent(), kaldi::UnitTestCopyCols(), kaldi::UnitTestCopyRows(), kaldi::UnitTestCopyToRows(), kaldi::UnitTestCuDiffLogSoftmax(), kaldi::UnitTestCuDiffNormalizePerRow(), kaldi::UnitTestCuDiffSigmoid(), kaldi::UnitTestCuDiffSoftmax(), kaldi::UnitTestCuDiffTanh(), kaldi::UnitTestCuFindRowMaxId(), kaldi::UnitTestCuLogSoftmax(), kaldi::UnitTestCuMathComputeLstmNonlinearity(), kaldi::UnitTestCuMathNormalizePerRow(), kaldi::UnitTestCuMathNormalizePerRow_v2(), kaldi::UnitTestCuMatrixAdd(), kaldi::UnitTestCuMatrixAddMat(), kaldi::UnitTestCuMatrixAddMatMat(), kaldi::UnitTestCuMatrixAddMatMatBatched(), kaldi::UnitTestCuMatrixAddMatTp(), kaldi::UnitTestCuMatrixAddRowRanges(), kaldi::UnitTestCuMatrixAddTpMat(), kaldi::UnitTestCuMatrixAddVecToCols(), kaldi::UnitTestCuMatrixAddVecToRows(), kaldi::UnitTestCuMatrixApplyCeiling(), kaldi::UnitTestCuMatrixApplyExp(), kaldi::UnitTestCuMatrixApplyExpLimited(), kaldi::UnitTestCuMatrixApplyExpSpecial(), kaldi::UnitTestCuMatrixApplyFloor(), kaldi::UnitTestCuMatrixApplyHeaviside(), kaldi::UnitTestCuMatrixApplyPow(), kaldi::UnitTestCuMatrixApplyPowAbs(), kaldi::UnitTestCuMatrixCopyFromMat(), kaldi::UnitTestCuMatrixDiffGroupPnorm(), kaldi::UnitTestCuMatrixDivElements(), kaldi::UnitTestCuMatrixDivRowsVec(), kaldi::UnitTestCuMatrixGroupMax(), kaldi::UnitTestCuMatrixGroupMaxDeriv(), kaldi::UnitTestCuMatrixGroupPnorm(), kaldi::UnitTestCuMatrixHeaviside(), kaldi::UnitTestCuMatrixMax(), kaldi::UnitTestCuMatrixMin(), kaldi::UnitTestCuMatrixMulColsVec(), kaldi::UnitTestCuMatrixMulElements(), kaldi::UnitTestCuMatrixMulRowsGroupMat(), kaldi::UnitTestCuMatrixMulRowsVec(), kaldi::UnitTestCuMatrixScale(), kaldi::UnitTestCuMatrixSetRandn(), kaldi::UnitTestCuMatrixSigmoid(), kaldi::UnitTestCuMatrixSoftHinge(), kaldi::UnitTestCuMatrixSumColumnRanges(), kaldi::UnitTestCuSigmoid(), kaldi::UnitTestCuSoftmax(), kaldi::UnitTestCuSpMatrixAddMat2(), kaldi::UnitTestCuSpMatrixConstructor(), kaldi::UnitTestCuTanh(), kaldi::UnitTestCuTpMatrixCholesky(), kaldi::UnitTestCuVectorAddColSumMat(), kaldi::UnitTestCuVectorAddColSumMatLarge(), kaldi::UnitTestCuVectorAddRowSumMat(), kaldi::UnitTestCuVectorAddRowSumMatLarge(), kaldi::UnitTestExtractCompressedMatrix(), kaldi::UnitTestFloorChol(), kaldi::UnitTestFloorUnit(), kaldi::UnitTestFmllrRaw(), kaldi::UnitTestGeneralMatrix(), kaldi::UnitTestHtkIo(), kaldi::UnitTestIo(), kaldi::UnitTestIoCross(), kaldi::UnitTestLimitCondInvert(), kaldi::UnitTestMat2Vec(), kaldi::UnitTestMatrix(), kaldi::UnitTestMatrixAddMatSmat(), kaldi::UnitTestMatrixAddSmatMat(), kaldi::UnitTestMaxMin(), kaldi::nnet2::UnitTestNnetDecodable(), kaldi::UnitTestNonsymmetricPower(), kaldi::UnitTestNorm(), kaldi::UnitTestOrthogonalizeRows(), kaldi::UnitTestPca(), kaldi::UnitTestPca2(), kaldi::UnitTestPldaEstimation(), kaldi::UnitTestPosteriors(), kaldi::nnet3::UnitTestPreconditionDirectionsOnline(), kaldi::nnet2::UnitTestPreconditionDirectionsOnline(), kaldi::UnitTestRange(), kaldi::UnitTestRankNUpdate(), kaldi::UnitTestRegtreeFmllrDiagGmm(), kaldi::UnitTestRemoveRow(), kaldi::UnitTestResize(), kaldi::UnitTestSetRandn(), kaldi::UnitTestSetZeroAboveDiag(), kaldi::UnitTestSimpleForMat(), kaldi::UnitTestSimpleForVec(), kaldi::UnitTestSolve(), kaldi::UnitTestSparseMatrixAddToMat(), kaldi::UnitTestSparseMatrixConstructor(), kaldi::UnitTestSparseMatrixFrobeniusNorm(), kaldi::UnitTestSparseMatrixSum(), kaldi::UnitTestSparseMatrixTraceMatSmat(), kaldi::UnitTestSvd(), kaldi::UnitTestSvdNodestroy(), kaldi::UnitTestSvdSpeed(), kaldi::UnitTestSwapCu2Cu(), kaldi::UnitTestSwapCu2M(), kaldi::UnitTestSymAddMat2(), kaldi::UnitTestTrace(), kaldi::UnitTestTraceProduct(), kaldi::UnitTestTrain(), kaldi::UnitTestTranspose(), kaldi::UnitTestVecmul(), kaldi::UnitTextCuMatrixAddMatSmat(), kaldi::UnitTextCuMatrixAddSmat(), and kaldi::UnitTextCuMatrixAddSmatMat().
void SetRandUniform | ( | ) |
Sets to numbers uniformly distributed on (0, 1)
Definition at line 1368 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::operator()(), kaldi::UnitTestCuMatrixApplyLog(), kaldi::UnitTestCuMatrixDivElements(), and kaldi::UnitTestSetRandUniform().
void SetUnit | ( | ) |
Sets to zero, except ones along diagonal [for non-square matrices too].
Definition at line 1348 of file kaldi-matrix.cc.
Referenced by BasisFmllrAccus::AccuGradientScatter(), FmllrSgmm2Accs::AccumulateForFmllrSubspace(), kaldi::ComputeFmllrMatrixDiagGmm(), AmSgmm2::ComputeFmllrPreXform(), kaldi::ComputeMllrMatrix(), LinearVtln::ComputeTransform(), BasisFmllrEstimate::ComputeTransform(), MultiBasisComponent::InitData(), kaldi::InitFmllr(), main(), MatrixBase< float >::operator()(), kaldi::nnet3::PerturbImage(), TestSgmm2FmllrAccsIO(), TestSgmm2FmllrSubspace(), SpMatrix< float >::TopEigs(), SpMatrix< float >::Tridiagonalize(), kaldi::UnitTestFmllrDiagGmm(), kaldi::UnitTestFmllrDiagGmmDiagonal(), kaldi::UnitTestFmllrDiagGmmOffset(), kaldi::UnitTestFmllrRaw(), kaldi::UnitTestSimple(), RegtreeMllrDiagGmmAccs::Update(), RegtreeFmllrDiagGmmAccs::Update(), and IvectorExtractorStats::UpdatePrior().
void SetZero | ( | ) |
Sets matrix to zero.
Definition at line 1330 of file kaldi-matrix.cc.
Referenced by BasisFmllrEstimate::ComputeTransform(), SparseMatrix< float >::CopyToMat(), kaldi::CreateEigenvalueMatrix(), kaldi::generate_features(), OnlineCmvn::GetMostRecentCachedFrame(), IvectorExtractorStats::GetOrthogonalIvectorTransform(), MatrixBase< float >::operator()(), AccumFullGmm::Read(), LdaEstimate::Read(), AffineXformStats::SetZero(), AccumFullGmm::SetZero(), AccumDiagGmm::SetZero(), FmllrRawAccs::SetZero(), LogisticRegression::Train(), kaldi::UnitTestAddOuterProductPlusMinus(), kaldi::UnitTestDeterminant(), kaldi::UnitTestDiagGmm(), UnitTestFullGmm(), kaldi::UnitTestSimple(), kaldi::UnitTestSvd(), kaldi::UnitTestSvdZero(), FmllrSgmm2Accs::Update(), MleAmSgmm2Updater::UpdateW(), and LdaEstimate::ZeroAccumulators().
void Sigmoid | ( | const MatrixBase< Real > & | src | ) |
Set each element to the sigmoid of the corresponding element of "src".
Definition at line 2978 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::MinSingularValue(), kaldi::UnitTestCuMatrixSigmoid(), and kaldi::UnitTestSigmoid().
|
inline |
Returns size in bytes of the data held by the matrix.
Definition at line 73 of file kaldi-matrix.h.
void SoftHinge | ( | const MatrixBase< Real > & | src | ) |
Set each element to y = log(1 + exp(x))
Definition at line 2778 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::MinSingularValue(), kaldi::UnitTestCuMatrixSoftHinge(), and kaldi::UnitTestSoftHinge().
|
inline |
Stride (distance in memory between each row). Will be >= NumCols.
Definition at line 70 of file kaldi-matrix.h.
Referenced by VectorBase< float >::AddDiagMat2(), VectorBase< float >::AddDiagMatMat(), MatrixBase< float >::AddDiagVecMat(), SpMatrix< float >::AddMat2(), SpMatrix< float >::AddMat2Sp(), SpMatrix< float >::AddMat2Vec(), MatrixBase< float >::AddMatDiagVec(), MatrixBase< float >::AddMatMatElements(), VectorBase< float >::AddMatSvec(), VectorBase< float >::AddMatVec(), kaldi::AddOuterProductPlusMinus(), VectorBase< float >::AddRowSumMat(), SpMatrix< float >::AddSmat2Sp(), SparseMatrix< float >::AddToMat(), VectorBase< float >::CopyColsFromMat(), VectorBase< float >::CopyDiagFromMat(), TpMatrix< float >::CopyFromMat(), SpMatrix< float >::CopyFromMat(), CompressedMatrix::CopyFromMat(), MatrixBase< float >::CopyFromMat(), CuMatrixBase< float >::CopyFromMat(), CuVectorBase< float >::CopyRowsFromMat(), VectorBase< float >::CopyRowsFromMat(), SparseMatrix< float >::CopyToMat(), CuMatrixBase< float >::CopyToMat(), kaldi::cu::CpuComputeLstmNonlinearity(), DecodableMatrixMapped::DecodableMatrixMapped(), TpMatrix< float >::Invert(), MatrixBase< float >::LapackGesvd(), kaldi::PlaceNansInGaps(), kaldi::QrStep(), SubMatrix< Real >::SubMatrix(), MatrixBase< float >::SymAddMat2(), kaldi::TraceMatSmat(), kaldi::TraceSpMat(), and SpMatrix< float >::Tridiagonalize().
Real Sum | ( | ) | const |
Returns sum of all elements in matrix.
Definition at line 1170 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ColRange(), AmSgmm2::ComponentPosteriors(), main(), kaldi::UnitTestAddMatMatNans(), kaldi::UnitTestCuMatrixReduceSum(), kaldi::UnitTestCuMatrixTraceMatMat(), kaldi::UnitTestPca(), kaldi::UnitTestRange(), kaldi::UnitTestScale(), kaldi::UnitTestSetRandn(), kaldi::UnitTestSetRandUniform(), kaldi::UnitTestSimpleForMat(), kaldi::UnitTestSparseMatrixSum(), and kaldi::UnitTestSymAddMat2().
void Svd | ( | VectorBase< Real > * | s, |
MatrixBase< Real > * | U, | ||
MatrixBase< Real > * | Vt | ||
) | const |
Compute SVD (*this) = U diag(s) Vt.
Note that the V in the call is already transposed; the normal formulation is U diag(s) V^T. Null pointers for U or V mean we don't want that output (this saves compute). The singular values are not sorted (use SortSvd for that).
Definition at line 1825 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ApplyLog(), MatrixBase< float >::Cond(), LdaEstimate::Estimate(), FeatureTransformEstimate::EstimateInternal(), MatrixBase< float >::MinSingularValue(), kaldi::nnet3::PrintParameterStats(), MatrixBase< float >::SymPosSemiDefEig(), kaldi::UnitTestDeterminantSign(), kaldi::UnitTestSvdBad(), kaldi::UnitTestSvdJustvec(), kaldi::UnitTestSvdNodestroy(), and kaldi::UnitTestSvdSpeed().
|
inline |
Compute SVD but only retain the singular values.
Definition at line 426 of file kaldi-matrix.h.
Referenced by MatrixBase< float >::Svd().
void SymAddMat2 | ( | const Real | alpha, |
const MatrixBase< Real > & | M, | ||
MatrixTransposeType | transA, | ||
Real | beta | ||
) |
*this = beta * *this + alpha * M M^T, for symmetric matrices.
It only updates the lower triangle of *this. It will leave the matrix asymmetric; if you need it symmetric as a regular matrix, do CopyLowerToUpper().
When the matrix dimension(this->num_rows_) is not less than 56 and the transpose type transA == kTrans, the cblas_Xsyrk(...) function will produce NaN in the output. This is a bug in the ATLAS library. To overcome this, the AddMatMat function, which calls cblas_Xgemm(...) rather than cblas_Xsyrk(...), is used in this special sitation. Wei Shi: Note this bug is observerd for single precision matrix on a 64-bit machine
Definition at line 233 of file kaldi-matrix.cc.
Referenced by kaldi::UnitTestAddMat2(), and kaldi::UnitTestSymAddMat2().
void SymPosSemiDefEig | ( | VectorBase< Real > * | s, |
MatrixBase< Real > * | P, | ||
Real | check_thresh = 0.001 |
||
) |
Uses Svd to compute the eigenvalue decomposition of a symmetric positive semi-definite matrix: (*this) = rP * diag(rS) * rP^T, with rP an orthogonal matrix so rP^{-1} = rP^T.
Throws exception if input was not positive semi-definite (check_thresh controls how stringent the check is; set it to 2 to ensure it won't ever complain, but it will zero out negative dimensions in your matrix.
Caution: if you want the eigenvalues, it may make more sense to convert to SpMatrix and use Eig() function there, which uses eigenvalue decomposition directly rather than SVD.
Definition at line 1996 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::MinSingularValue(), and UnitTestEstimateFullGmm().
void Tanh | ( | const MatrixBase< Real > & | src | ) |
Set each element to the tanh of the corresponding element of "src".
Definition at line 2762 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::MinSingularValue(), kaldi::UnitTestCuTanh(), and kaldi::UnitTestTanh().
void TestUninitialized | ( | ) | const |
Definition at line 1879 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::MinSingularValue().
Real Trace | ( | bool | check_square = true | ) | const |
Returns trace of matrix.
Definition at line 1709 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ColRange(), kaldi::CuVectorUnitTestCopyDiagFromMat(), kaldi::TraceMat(), kaldi::UnitTestCuMatrixCopyLowerToUpper(), kaldi::UnitTestCuMatrixCopyUpperToLower(), and kaldi::UnitTestTrace().
void Transpose | ( | ) |
Transpose the matrix.
This one is only applicable to square matrices (the one in the Matrix child class works also for non-square.
Definition at line 2079 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::ColRange(), MatrixBase< float >::DestructiveSvd(), SpMatrix< float >::Eig(), Matrix< BaseFloat >::Matrix(), and MatrixBase< float >::Svd().
void Write | ( | std::ostream & | out, |
bool | binary | ||
) | const |
write to stream.
Definition at line 1379 of file kaldi-matrix.cc.
Referenced by MatrixBase< float >::AddTpTp(), main(), kaldi::UnitTestCompressedMatrix(), kaldi::UnitTestIo(), kaldi::UnitTestIoCross(), kaldi::UnitTestKeele(), kaldi::UnitTestKeeleNccfBallast(), kaldi::UnitTestPenaltyFactor(), kaldi::UnitTestProcess(), AffineXformStats::Write(), CompressedAffineXformStats::Write(), LogisticRegression::Write(), AccumFullGmm::Write(), LdaEstimate::Write(), Sgmm2FmllrGlobalParams::Write(), FullGmm::Write(), MleAmSgmm2Accs::Write(), Plda::Write(), CompressedMatrix::Write(), DiagGmm::Write(), Fmpe::Write(), OnlineGmmAdaptationState::Write(), OnlineCmvnState::Write(), LstmNonlinearityComponent::Write(), IvectorExtractorStats::Write(), CuMatrixBase< float >::Write(), and KlHmm::WriteData().
|
friend |
Definition at line 55 of file kaldi-matrix.h.
|
friend |
Definition at line 54 of file kaldi-matrix.h.
|
friend |
Definition at line 57 of file kaldi-matrix.h.
|
friend |
Definition at line 56 of file kaldi-matrix.h.
|
friend |
|
friend |
Definition at line 52 of file kaldi-matrix.h.
|
friend |
Definition at line 58 of file kaldi-matrix.h.
|
friend |
Definition at line 61 of file kaldi-matrix.h.
|
friend |
Definition at line 60 of file kaldi-matrix.h.
|
friend |
Definition at line 59 of file kaldi-matrix.h.
|
friend |
Definition at line 586 of file kaldi-matrix.h.
|
protected |
data memory area
Definition at line 808 of file kaldi-matrix.h.
Referenced by MatrixBase< float >::Add(), MatrixBase< float >::AddCols(), MatrixBase< float >::AddMat(), MatrixBase< float >::AddMatMat(), MatrixBase< float >::AddMatSmat(), MatrixBase< float >::AddSmatMat(), MatrixBase< float >::AddToDiag(), MatrixBase< float >::CopyCols(), MatrixBase< float >::Data(), MatrixBase< float >::Data_workaround(), MatrixBase< float >::DiffSigmoid(), MatrixBase< float >::DiffTanh(), MatrixBase< float >::Max(), MatrixBase< float >::Min(), MatrixBase< float >::MulElements(), MatrixBase< float >::operator()(), MatrixBase< float >::Row(), MatrixBase< float >::RowData(), MatrixBase< float >::Sigmoid(), PackedMatrix< float >::Swap(), Matrix< BaseFloat >::Swap(), CuMatrix< float >::Swap(), MatrixBase< float >::SymAddMat2(), MatrixBase< float >::Tanh(), MatrixBase< float >::Trace(), and kaldi::TraceMatMat().
|
protected |
these attributes store the real matrix size as it is stored in memory including memalignment
Definition at line 812 of file kaldi-matrix.h.
Referenced by MatrixBase< float >::Add(), MatrixBase< float >::AddMat(), MatrixBase< float >::AddMatMat(), MatrixBase< float >::AddMatMatMat(), MatrixBase< float >::AddMatSmat(), MatrixBase< float >::AddSmatMat(), MatrixBase< float >::AddToDiag(), MatrixBase< float >::ApproxEqual(), MatrixBase< float >::Cond(), MatrixBase< float >::DestructiveSvd(), MatrixBase< float >::Equal(), MatrixBase< float >::IsDiagonal(), MatrixBase< float >::IsSymmetric(), MatrixBase< float >::IsUnit(), MatrixBase< float >::IsZero(), MatrixBase< float >::LapackGesvd(), MatrixBase< float >::LargestAbsElem(), Matrix< BaseFloat >::Matrix(), MatrixBase< float >::Max(), MatrixBase< float >::Min(), MatrixBase< float >::NumCols(), MatrixBase< float >::operator()(), MatrixBase< float >::Read(), Matrix< BaseFloat >::Read(), MatrixBase< float >::RowRange(), MatrixBase< float >::Sigmoid(), SubMatrix< Real >::SubMatrix(), MatrixBase< float >::Svd(), Matrix< BaseFloat >::Swap(), CuMatrix< float >::Swap(), MatrixBase< float >::SymAddMat2(), MatrixBase< float >::SymPosSemiDefEig(), MatrixBase< float >::Tanh(), MatrixBase< float >::TestUninitialized(), and MatrixBase< float >::Trace().
|
protected |
< Number of columns
Definition at line 813 of file kaldi-matrix.h.
Referenced by MatrixBase< float >::Add(), MatrixBase< float >::AddMat(), MatrixBase< float >::AddMatMat(), MatrixBase< float >::AddMatMatMat(), MatrixBase< float >::AddMatSmat(), MatrixBase< float >::AddSmatMat(), MatrixBase< float >::AddToDiag(), MatrixBase< float >::ApproxEqual(), MatrixBase< float >::ColRange(), MatrixBase< float >::Cond(), MatrixBase< float >::DestructiveSvd(), MatrixBase< float >::Equal(), MatrixBase< float >::IsDiagonal(), MatrixBase< float >::IsSymmetric(), MatrixBase< float >::IsUnit(), MatrixBase< float >::IsZero(), MatrixBase< float >::LapackGesvd(), MatrixBase< float >::LargestAbsElem(), Matrix< BaseFloat >::Matrix(), MatrixBase< float >::Max(), MatrixBase< float >::Min(), MatrixBase< float >::NumRows(), MatrixBase< float >::operator()(), MatrixBase< float >::OrthogonalizeRows(), MatrixBase< float >::Read(), Matrix< BaseFloat >::Read(), MatrixBase< float >::Row(), MatrixBase< float >::RowData(), MatrixBase< float >::SizeInBytes(), SubMatrix< Real >::SubMatrix(), MatrixBase< float >::Svd(), PackedMatrix< float >::Swap(), Matrix< BaseFloat >::Swap(), CuMatrix< float >::Swap(), MatrixBase< float >::SymAddMat2(), MatrixBase< float >::SymPosSemiDefEig(), MatrixBase< float >::TestUninitialized(), and MatrixBase< float >::Trace().
|
protected |
< Number of rows
True number of columns for the internal matrix. This number may differ from num_cols_ as memory alignment might be used.
Definition at line 816 of file kaldi-matrix.h.
Referenced by MatrixBase< float >::Add(), MatrixBase< float >::AddCols(), MatrixBase< float >::AddMat(), MatrixBase< float >::AddMatMat(), MatrixBase< float >::AddMatSmat(), MatrixBase< float >::AddSmatMat(), MatrixBase< float >::AddToDiag(), MatrixBase< float >::Ceiling(), MatrixBase< float >::CopyCols(), MatrixBase< float >::DiffSigmoid(), MatrixBase< float >::DiffTanh(), MatrixBase< float >::Exp(), MatrixBase< float >::ExpLimited(), MatrixBase< float >::ExpSpecial(), MatrixBase< float >::Floor(), MatrixBase< float >::Heaviside(), MatrixBase< float >::Log(), MatrixBase< float >::Max(), MatrixBase< float >::Min(), MatrixBase< float >::MulElements(), MatrixBase< float >::operator()(), MatrixBase< float >::Pow(), MatrixBase< float >::PowAbs(), MatrixBase< float >::Row(), MatrixBase< float >::RowData(), MatrixBase< float >::Sigmoid(), MatrixBase< float >::SizeInBytes(), MatrixBase< float >::Stride(), SubMatrix< Real >::SubMatrix(), Matrix< BaseFloat >::Swap(), CuMatrix< float >::Swap(), MatrixBase< float >::Tanh(), MatrixBase< float >::Trace(), and kaldi::TraceMatMat().