Functions | |
template<typename Real > | |
bool | ApproxEqual (const MatrixBase< Real > &A, const MatrixBase< Real > &B, Real tol=0.01) |
template<typename Real > | |
void | AssertEqual (const MatrixBase< Real > &A, const MatrixBase< Real > &B, float tol=0.01) |
template<typename Real > | |
double | TraceMat (const MatrixBase< Real > &A) |
Returns trace of matrix. More... | |
template<typename Real > | |
Real | TraceMatMatMat (const MatrixBase< Real > &A, MatrixTransposeType transA, const MatrixBase< Real > &B, MatrixTransposeType transB, const MatrixBase< Real > &C, MatrixTransposeType transC) |
Returns tr(A B C) More... | |
template<typename Real > | |
Real | TraceMatMatMatMat (const MatrixBase< Real > &A, MatrixTransposeType transA, const MatrixBase< Real > &B, MatrixTransposeType transB, const MatrixBase< Real > &C, MatrixTransposeType transC, const MatrixBase< Real > &D, MatrixTransposeType transD) |
Returns tr(A B C D) More... | |
template<typename Real > | |
bool | ApproxEqual (const VectorBase< Real > &a, const VectorBase< Real > &b, Real tol=0.01) |
template<typename Real > | |
void | AssertEqual (VectorBase< Real > &a, VectorBase< Real > &b, float tol=0.01) |
template<typename Real > | |
Real | VecVec (const VectorBase< Real > &v1, const VectorBase< Real > &v2) |
Returns dot product between v1 and v2. More... | |
template<typename Real , typename OtherReal > | |
Real | VecVec (const VectorBase< Real > &ra, const VectorBase< OtherReal > &rb) |
template<typename Real > | |
Real | VecMatVec (const VectorBase< Real > &v1, const MatrixBase< Real > &M, const VectorBase< Real > &v2) |
Returns . More... | |
float | TraceSpSp (const SpMatrix< float > &A, const SpMatrix< float > &B) |
Returns tr(A B). More... | |
double | TraceSpSp (const SpMatrix< double > &A, const SpMatrix< double > &B) |
template<typename Real > | |
bool | ApproxEqual (const SpMatrix< Real > &A, const SpMatrix< Real > &B, Real tol=0.01) |
template<typename Real > | |
void | AssertEqual (const SpMatrix< Real > &A, const SpMatrix< Real > &B, Real tol=0.01) |
template<typename Real , typename OtherReal > | |
Real | TraceSpSp (const SpMatrix< Real > &A, const SpMatrix< OtherReal > &B) |
Returns tr(A B). More... | |
template<typename Real > | |
Real | TraceSpSpLower (const SpMatrix< Real > &A, const SpMatrix< Real > &B) |
template<typename Real > | |
Real | TraceSpMat (const SpMatrix< Real > &A, const MatrixBase< Real > &B) |
Returns tr(A B). More... | |
template<typename Real > | |
Real | TraceMatSpMat (const MatrixBase< Real > &A, MatrixTransposeType transA, const SpMatrix< Real > &B, const MatrixBase< Real > &C, MatrixTransposeType transC) |
Returns tr(A B C) (A and C may be transposed as specified by transA and transC). More... | |
template<typename Real > | |
Real | TraceMatSpMatSp (const MatrixBase< Real > &A, MatrixTransposeType transA, const SpMatrix< Real > &B, const MatrixBase< Real > &C, MatrixTransposeType transC, const SpMatrix< Real > &D) |
Returns tr (A B C D) (A and C may be transposed as specified by transA and transB). More... | |
template<typename Real > | |
Real | VecSpVec (const VectorBase< Real > &v1, const SpMatrix< Real > &M, const VectorBase< Real > &v2) |
Computes v1^T * M * v2. More... | |
|
inline |
Definition at line 375 of file sp-matrix.h.
bool kaldi::ApproxEqual | ( | const VectorBase< Real > & | a, |
const VectorBase< Real > & | b, | ||
Real | tol = 0.01 |
||
) |
Definition at line 576 of file kaldi-vector.h.
References VectorBase< Real >::ApproxEqual().
bool kaldi::ApproxEqual | ( | const MatrixBase< Real > & | A, |
const MatrixBase< Real > & | B, | ||
Real | tol = 0.01 |
||
) |
Definition at line 1029 of file kaldi-matrix.h.
References MatrixBase< Real >::ApproxEqual().
|
inline |
Definition at line 381 of file sp-matrix.h.
References SpMatrix< Real >::ApproxEqual(), KALDI_ASSERT, kaldi::TraceMatSpMat(), kaldi::TraceMatSpMatSp(), kaldi::TraceSpMat(), kaldi::TraceSpSp(), kaldi::TraceSpSpLower(), and kaldi::VecSpVec().
|
inline |
Definition at line 582 of file kaldi-vector.h.
References VectorBase< Real >::ApproxEqual(), KALDI_ASSERT, kaldi::VecMatVec(), and kaldi::VecVec().
|
inline |
Definition at line 1035 of file kaldi-matrix.h.
References MatrixBase< Real >::ApproxEqual(), and KALDI_ASSERT.
double kaldi::TraceMat | ( | const MatrixBase< Real > & | A | ) |
Returns trace of matrix.
Definition at line 1042 of file kaldi-matrix.h.
References kaldi::AttemptComplexPower(), kaldi::CreateEigenvalueMatrix(), kaldi::operator>>(), kaldi::SortSvd(), MatrixBase< Real >::Trace(), kaldi::TraceMatMatMat(), and kaldi::TraceMatMatMatMat().
Referenced by kaldi::CalBasisFmllrStepSize(), kaldi::CalcFmllrStepSize(), and kaldi::UnitTestTrace().
Real TraceMatMatMat | ( | const MatrixBase< Real > & | A, |
MatrixTransposeType | transA, | ||
const MatrixBase< Real > & | B, | ||
MatrixTransposeType | transB, | ||
const MatrixBase< Real > & | C, | ||
MatrixTransposeType | transC | ||
) |
Returns tr(A B C)
Definition at line 2502 of file kaldi-matrix.cc.
References MatrixBase< Real >::AddMatMat(), KALDI_ASSERT, kaldi::kTrans, MatrixBase< Real >::NumCols(), MatrixBase< Real >::NumRows(), kaldi::swap(), kaldi::TraceMatMat(), and kaldi::TraceMatMatMat().
Referenced by kaldi::TraceMat(), and kaldi::UnitTestTrace().
Real TraceMatMatMatMat | ( | const MatrixBase< Real > & | A, |
MatrixTransposeType | transA, | ||
const MatrixBase< Real > & | B, | ||
MatrixTransposeType | transB, | ||
const MatrixBase< Real > & | C, | ||
MatrixTransposeType | transC, | ||
const MatrixBase< Real > & | D, | ||
MatrixTransposeType | transD | ||
) |
Returns tr(A B C D)
Definition at line 2538 of file kaldi-matrix.cc.
References MatrixBase< Real >::AddMatMat(), KALDI_ASSERT, kaldi::kNoTrans, kaldi::kTrans, MatrixBase< Real >::NumCols(), MatrixBase< Real >::NumRows(), kaldi::swap(), kaldi::TraceMatMatMat(), and kaldi::TraceMatMatMatMat().
Referenced by kaldi::TraceMat(), and kaldi::UnitTestTrace().
Real TraceMatSpMat | ( | const MatrixBase< Real > & | A, |
MatrixTransposeType | transA, | ||
const SpMatrix< Real > & | B, | ||
const MatrixBase< Real > & | C, | ||
MatrixTransposeType | transC | ||
) |
Returns tr(A B C) (A and C may be transposed as specified by transA and transC).
Definition at line 415 of file sp-matrix.cc.
References MatrixBase< Real >::AddMatMat(), KALDI_ASSERT, kaldi::kTrans, MatrixBase< Real >::NumCols(), MatrixBase< Real >::NumRows(), PackedMatrix< Real >::NumRows(), and kaldi::TraceSpMat().
Referenced by kaldi::AssertEqual(), kaldi::UnitTestSolve(), and kaldi::UnitTestTrace().
Real TraceMatSpMatSp | ( | const MatrixBase< Real > & | A, |
MatrixTransposeType | transA, | ||
const SpMatrix< Real > & | B, | ||
const MatrixBase< Real > & | C, | ||
MatrixTransposeType | transC, | ||
const SpMatrix< Real > & | D | ||
) |
Returns tr (A B C D) (A and C may be transposed as specified by transA and transB).
Definition at line 438 of file sp-matrix.cc.
References MatrixBase< Real >::AddMatSp(), KALDI_ASSERT, kaldi::kNoTrans, kaldi::kTrans, MatrixBase< Real >::NumCols(), PackedMatrix< Real >::NumCols(), MatrixBase< Real >::NumRows(), PackedMatrix< Real >::NumRows(), and kaldi::TraceMatMat().
Referenced by kaldi::AssertEqual(), kaldi::CalcFmllrStepSize(), kaldi::UnitTestSolve(), and kaldi::UnitTestTrace().
Real TraceSpMat | ( | const SpMatrix< Real > & | A, |
const MatrixBase< Real > & | B | ||
) |
Returns tr(A B).
No option to transpose B because would make no difference.
Definition at line 389 of file sp-matrix.cc.
References MatrixBase< Real >::Data(), PackedMatrix< Real >::Data(), KALDI_ASSERT, MatrixBase< Real >::NumCols(), PackedMatrix< Real >::NumCols(), MatrixBase< Real >::NumRows(), PackedMatrix< Real >::NumRows(), and MatrixBase< Real >::Stride().
Referenced by kaldi::AssertEqual(), kaldi::TraceMatSpMat(), and kaldi::UnitTestTrace().
Definition at line 326 of file sp-matrix.cc.
References kaldi::cblas_Xdot(), PackedMatrix< Real >::Data(), KALDI_ASSERT, and PackedMatrix< Real >::NumRows().
Referenced by kaldi::AssertEqual(), MleAmSgmm2Updater::ComputeMPrior(), PldaEstimator::ComputeObjfPart1(), IvectorExtractor::GetAcousticAuxfMean(), IvectorExtractor::GetAcousticAuxfVariance(), IvectorExtractor::GetAcousticAuxfWeight(), CuSpMatrix< Real >::IsUnit(), SpMatrix< float >::LimitCondDouble(), kaldi::MlObjective(), kaldi::SolveQuadraticMatrixProblem(), kaldi::TraceSpSp(), kaldi::UnitTestCuSpMatrixTraceSpSp(), kaldi::UnitTestDeterminant(), kaldi::UnitTestTraceSpSpLower(), IvectorExtractorStats::UpdateVariances(), EbwAmSgmm2Updater::UpdateVars(), and MleAmSgmm2Updater::UpdateVars().
Returns tr(A B).
Definition at line 346 of file sp-matrix.cc.
References kaldi::cblas_Xdot(), PackedMatrix< Real >::Data(), KALDI_ASSERT, and PackedMatrix< Real >::NumRows().
Returns tr(A B).
Definition at line 367 of file sp-matrix.cc.
References PackedMatrix< Real >::Data(), KALDI_ASSERT, PackedMatrix< Real >::NumRows(), kaldi::TraceSpSp< double, float >(), and kaldi::TraceSpSp< float, double >().
Definition at line 1171 of file sp-matrix.cc.
References kaldi::cblas_Xdot(), PackedMatrix< Real >::Data(), KALDI_ASSERT, PackedMatrix< Real >::NumRows(), kaldi::SolveDoubleQuadraticMatrixProblem(), and kaldi::SolveQuadraticMatrixProblem().
Referenced by kaldi::AssertEqual(), FullGmm::LogLikelihoods(), FullGmm::LogLikelihoodsPreselect(), and kaldi::UnitTestTraceSpSpLower().
Real VecMatVec | ( | const VectorBase< Real > & | v1, |
const MatrixBase< Real > & | M, | ||
const VectorBase< Real > & | v2 | ||
) |
Returns .
Not as efficient as it could be where v1 == v2.
Definition at line 1281 of file kaldi-vector.cc.
References VectorBase< Real >::AddMatVec(), VectorBase< Real >::Dim(), KALDI_ASSERT, kaldi::kNoTrans, MatrixBase< Real >::NumCols(), MatrixBase< Real >::NumRows(), kaldi::VecMatVec(), and kaldi::VecVec().
Referenced by kaldi::AssertEqual(), kaldi::UnitTestVecMatVec(), kaldi::VecMatVec(), and Vector< float >::Vector().
Real VecSpVec | ( | const VectorBase< Real > & | v1, |
const SpMatrix< Real > & | M, | ||
const VectorBase< Real > & | v2 | ||
) |
Computes v1^T * M * v2.
Not as efficient as it could be where v1 == v2 (but no suitable blas routines available).Returns Not as efficient as it could be where v1 == v2.
Definition at line 964 of file sp-matrix.cc.
References kaldi::cblas_Xspmv(), VectorBase< Real >::Data(), PackedMatrix< Real >::Data(), VectorBase< Real >::Dim(), KALDI_ASSERT, PackedMatrix< Real >::NumRows(), and kaldi::VecVec().
Referenced by kaldi::AssertEqual(), FullGmm::ComponentLogLikelihood(), FullGmm::ComputeGconsts(), PldaEstimator::ComputeObjfPart2(), IvectorExtractor::GetAcousticAuxfMean(), FmllrRawAccs::GetAuxf(), GetLogLikeTest(), main(), OnlineIvectorEstimationStats::Objf(), kaldi::SolveDoubleQuadraticMatrixProblem(), kaldi::SolveQuadraticProblem(), kaldi::UnitTestFloorChol(), UnitTestFullGmm(), kaldi::UnitTestInnerProd(), kaldi::UnitTestLbfgs(), kaldi::UnitTestSolve(), MlltAccs::Update(), MleAmSgmm2Updater::UpdatePhoneVectorsInternal(), MleAmSgmm2Updater::UpdateW(), and MleSgmm2SpeakerAccs::UpdateWithU().
Real VecVec | ( | const VectorBase< Real > & | a, |
const VectorBase< Real > & | b | ||
) |
Returns dot product between v1 and v2.
Definition at line 37 of file kaldi-vector.cc.
References kaldi::cblas_Xdot(), VectorBase< Real >::Data(), VectorBase< Real >::Dim(), and KALDI_ASSERT.
Referenced by OptimizeLbfgs< Real >::AcceptStep(), OnlinePitchFeatureImpl::AcceptWaveform(), FmllrRawAccs::AccumulateForGmm(), kaldi::AddNoise(), kaldi::AssertEqual(), kaldi::CalBasisFmllrStepSize(), FullGmm::ComponentLogLikelihood(), DiagGmm::ComponentLogLikelihood(), SpectrogramComputer::Compute(), MelBanks::Compute(), MfccComputer::Compute(), FbankComputer::Compute(), PlpComputer::Compute(), kaldi::ComputeCorrelation(), kaldi::ComputeEarlyReverbEnergy(), OptimizeLbfgs< Real >::ComputeHifNeeded(), OptimizeLbfgs< Real >::ComputeNewDirection(), AmSgmm2::ComputeNormalizersInternal(), AmSgmm2::ComputePerFrameVars(), EbwAmSgmm2Updater::ComputePhoneVecStats(), LstmNonlinearityComponent::ConsolidateMemory(), kaldi::CuVectorUnitTestInvertElements(), kaldi::CuVectorUnitTestSum(), kaldi::CuVectorUnitTestVecVec(), ConvolutionComponent::DotProduct(), TimeHeightConvolutionComponent::DotProduct(), TdnnComponent::DotProduct(), RepeatedAffineComponent::DotProduct(), ConstantComponent::DotProduct(), AffineComponent::DotProduct(), BlockAffineComponent::DotProduct(), PerElementScaleComponent::DotProduct(), PerElementOffsetComponent::DotProduct(), ConstantFunctionComponent::DotProduct(), Convolutional1dComponent::DotProduct(), ScaleAndOffsetComponent::DotProduct(), kaldi::FindQuietestSegment(), kaldi::FmllrAuxfGradient(), kaldi::FmllrAuxFuncDiagGmm(), kaldi::FmllrInnerUpdate(), IvectorExtractor::GetAcousticAuxfGconst(), IvectorExtractor::GetAcousticAuxfMean(), IvectorExtractor::GetAcousticAuxfWeight(), FmllrRawAccs::GetAuxf(), Plda::GetNormalizationFactor(), IvectorExtractor::GetPriorAuxf(), AffineComponentPreconditioned::GetScalingFactor(), AffineComponent::Info(), AffineComponentPreconditioned::Info(), AffineComponentPreconditionedOnline::Info(), FixedAffineComponent::Info(), FixedScaleComponent::Info(), FixedBiasComponent::Info(), Convolutional1dComponent::Info(), kaldi::LinearCgd(), AmSgmm2::LogLikelihood(), Plda::LogLikelihoodRatio(), FullGmm::LogLikelihoodsPreselect(), DiagGmm::LogLikelihoodsPreselect(), DecodableAmDiagGmmRegtreeFmllr::LogLikelihoodZeroBased(), main(), kaldi::MllrAuxFunction(), kaldi::MlObjective(), VectorClusterable::Objf(), OnlineIvectorEstimationStats::Objf(), MatrixBase< float >::OrthogonalizeRows(), kaldi::nnet2::PreconditionDirections(), OnlineNaturalGradientSimple::PreconditionDirectionsCpu(), OnlinePreconditionerSimple::PreconditionDirectionsCpu(), kaldi::nnet3::PrintParameterStats(), kaldi::ProcessWindow(), ArbitraryResample::Resample(), LinearResample::Resample(), kaldi::SolveDoubleQuadraticMatrixProblem(), kaldi::SolveQuadraticProblem(), OptimizeLbfgs< Real >::StepSizeIteration(), kaldi::nnet3::SummarizeVector(), kaldi::TestCuVectorVecVecOne(), kaldi::nnet3::TestNnetComponentUpdatable(), SpMatrix< float >::TopEigs(), kaldi::TraceSpSp(), kaldi::UnitTestDotprod(), kaldi::UnitTestLbfgs(), UnitTestLinearResample2(), kaldi::UnitTestSnipEdges(), kaldi::UnitTestSolve(), kaldi::UnitTestSparseVectorVecSvec(), MlltAccs::Update(), MleAmSgmm2Updater::UpdatePhoneVectorsInternal(), OnlinePitchFeatureImpl::UpdateRemainder(), MleAmSgmm2Updater::UpdateW(), MleAmSgmm2Updater::UpdateWGetStats(), MleSgmm2SpeakerAccs::UpdateWithU(), kaldi::VecMatVec(), kaldi::VecSpVec(), VectorClusterable::VectorClusterable(), and kaldi::VecVec().
Real VecVec | ( | const VectorBase< Real > & | ra, |
const VectorBase< OtherReal > & | rb | ||
) |
Definition at line 52 of file kaldi-vector.cc.
References VectorBase< Real >::Data(), VectorBase< Real >::Dim(), rnnlm::i, and KALDI_ASSERT.