Various namespace-scope functions for I/O. More...
Classes | |
struct | HtkHeader |
A structure containing the HTK header. More... | |
Functions | |
template<typename Real > | |
bool | ReadHtk (std::istream &is, Matrix< Real > *M_ptr, HtkHeader *header_ptr) |
Extension of the HTK header. More... | |
template<typename Real > | |
bool | WriteHtk (std::ostream &os, const MatrixBase< Real > &M, HtkHeader htk_hdr) |
template<class Real > | |
bool | WriteSphinx (std::ostream &os, const MatrixBase< Real > &M) |
template<typename Real > | |
std::ostream & | operator<< (std::ostream &os, const MatrixBase< Real > &M) |
template<typename Real > | |
std::istream & | operator>> (std::istream &is, MatrixBase< Real > &M) |
template<typename Real > | |
std::istream & | operator>> (std::istream &is, Matrix< Real > &M) |
template<typename Real > | |
bool | SameDim (const MatrixBase< Real > &M, const MatrixBase< Real > &N) |
template<typename Real > | |
std::ostream & | operator<< (std::ostream &os, const VectorBase< Real > &rv) |
template<typename Real > | |
std::istream & | operator>> (std::istream &in, VectorBase< Real > &v) |
Input from a C++ stream. More... | |
template<typename Real > | |
std::istream & | operator>> (std::istream &in, Vector< Real > &v) |
Input from a C++ stream. More... | |
template<typename Real > | |
std::ostream & | operator<< (std::ostream &out, const PackedMatrix< Real > &M) |
template<typename Real > | |
std::istream & | operator>> (std::istream &is, PackedMatrix< Real > &M) |
Various namespace-scope functions for I/O.
end of "addtogroup matrix_group"
Output to a C++ stream.
Note that the << and >> operators are not recommended for normal use in Kaldi-style I/O (for that, use the Read and Write methods). The operators are mainly useful for logging and error output.
Non-binary by default (use Write for binary output).
std::ostream & operator<< | ( | std::ostream & | os, |
const VectorBase< Real > & | rv | ||
) |
Definition at line 30 of file kaldi-vector-inl.h.
std::ostream & operator<< | ( | std::ostream & | out, |
const PackedMatrix< Real > & | M | ||
) |
Definition at line 181 of file packed-matrix.h.
|
inline |
Definition at line 41 of file kaldi-matrix-inl.h.
std::istream & operator>> | ( | std::istream & | in, |
VectorBase< Real > & | v | ||
) |
Input from a C++ stream.
Will automatically read text or binary data from the stream.
Definition at line 36 of file kaldi-vector-inl.h.
References VectorBase< Real >::Read().
std::istream & operator>> | ( | std::istream & | in, |
Vector< Real > & | v | ||
) |
Input from a C++ stream.
Will automatically read text or binary data from the stream.
Definition at line 42 of file kaldi-vector-inl.h.
References VectorBase< Real >::AddVec(), and Vector< Real >::Read().
|
inline |
Definition at line 47 of file kaldi-matrix-inl.h.
References Matrix< Real >::Read().
Referenced by SubVector< Real >::operator=(), and kaldi::TraceMat().
|
inline |
Definition at line 54 of file kaldi-matrix-inl.h.
References MatrixBase< Real >::Read().
std::istream& kaldi::operator>> | ( | std::istream & | is, |
PackedMatrix< Real > & | M | ||
) |
Definition at line 187 of file packed-matrix.h.
Extension of the HTK header.
Definition at line 2303 of file kaldi-matrix.cc.
References rnnlm::i, rnnlm::j, KALDI_ASSERT_IS_FLOATING_TYPE, KALDI_ERR, KALDI_SWAP2, KALDI_SWAP4, KALDI_VLOG, KALDI_WARN, kaldi::MachineIsLittleEndian(), MatrixBase< Real >::NumCols(), MatrixBase< Real >::NumRows(), kaldi::ReadHtk(), Matrix< Real >::Resize(), and MatrixBase< Real >::RowData().
Referenced by main(), HtkMatrixHolder::Read(), UnitTestHTKCompare1(), UnitTestHTKCompare2(), UnitTestHTKCompare3(), UnitTestHTKCompare4(), UnitTestHTKCompare5(), UnitTestHTKCompare6(), and kaldi::UnitTestHtkIo().
bool kaldi::SameDim | ( | const MatrixBase< Real > & | M, |
const MatrixBase< Real > & | N | ||
) |
Definition at line 1111 of file kaldi-matrix.h.
References MatrixBase< Real >::NumCols(), and MatrixBase< Real >::NumRows().
Referenced by Fmpe::AccStats(), CuMatrixBase< float >::AddDiagVecMat(), MatrixBase< float >::AddDiagVecMat(), CuMatrixBase< float >::AddMatDiagVec(), MatrixBase< float >::AddMatDiagVec(), CuMatrixBase< float >::AddMatMatElements(), kaldi::nnet3::attention::AttentionBackward(), RestrictedAttentionComponent::Backprop(), BatchNormComponent::Backprop(), LogSoftmaxComponent::Backprop(), GeneralDropoutComponent::Backprop(), SpecAugmentTimeMaskComponent::Backprop(), DropoutComponent::Backprop(), ScaleAndOffsetComponent::Backprop(), kaldi::cu::BackpropLstmNonlinearity(), RestrictedAttentionComponent::BackpropOneHead(), CuMatrixBase< float >::Ceiling(), MatrixBase< float >::Ceiling(), NnetUpdater::ComputeObjfAndDeriv(), LstmNonlinearityComponent::ConsolidateMemory(), kaldi::cu::CpuBackpropLstmNonlinearity(), CuMatrixBase< float >::DiffLogSoftmaxPerRow(), CuMatrixBase< float >::DiffSigmoid(), MatrixBase< float >::DiffSigmoid(), CuMatrixBase< float >::DiffSoftmaxPerRow(), MatrixBase< float >::DiffTanh(), kaldi::cu::EnsureNonzero(), CuMatrixBase< float >::Exp(), MatrixBase< float >::Exp(), CuMatrixBase< float >::ExpLimited(), MatrixBase< float >::ExpLimited(), CuMatrixBase< float >::ExpSpecial(), MatrixBase< float >::ExpSpecial(), CuMatrixBase< float >::Floor(), MatrixBase< float >::Floor(), CuMatrixBase< float >::Heaviside(), MatrixBase< float >::Heaviside(), CuMatrixBase< float >::Log(), MatrixBase< float >::Log(), CuMatrixBase< float >::LogSoftMaxPerRow(), kaldi::cu::NormalizePerRow(), CuMatrixBase< float >::Pow(), MatrixBase< float >::Pow(), CuMatrixBase< float >::PowAbs(), MatrixBase< float >::PowAbs(), kaldi::nnet2::PreconditionDirections(), BatchNormComponent::Propagate(), GeneralDropoutComponent::Propagate(), SpecAugmentTimeMaskComponent::Propagate(), kaldi::cu::RegularizeL1(), CuMatrixBase< float >::Sigmoid(), MatrixBase< float >::Sigmoid(), kaldi::SlidingWindowCmn(), CuMatrixBase< float >::SoftHinge(), MatrixBase< float >::SoftHinge(), CuMatrixBase< float >::SoftMaxPerRow(), CuMatrixBase< float >::Tanh(), MatrixBase< float >::Tanh(), kaldi::TypeOneUsage(), kaldi::TypeOneUsageAverage(), and Fmpe::Update().
bool WriteHtk | ( | std::ostream & | os, |
const MatrixBase< Real > & | M, | ||
HtkHeader | htk_hdr | ||
) |
Definition at line 2403 of file kaldi-matrix.cc.
References rnnlm::i, rnnlm::j, KALDI_ASSERT, KALDI_SWAP2, KALDI_SWAP4, KALDI_WARN, kaldi::MachineIsLittleEndian(), HtkHeader::mNSamples, HtkHeader::mSampleKind, HtkHeader::mSamplePeriod, HtkHeader::mSampleSize, MatrixBase< Real >::NumCols(), MatrixBase< Real >::NumRows(), MatrixBase< Real >::RowData(), and kaldi::WriteHtk().
Referenced by main(), UnitTestHTKCompare1(), UnitTestHTKCompare2(), UnitTestHTKCompare3(), UnitTestHTKCompare4(), UnitTestHTKCompare5(), UnitTestHTKCompare6(), kaldi::UnitTestHtkIo(), and HtkMatrixHolder::Write().
bool WriteSphinx | ( | std::ostream & | os, |
const MatrixBase< Real > & | M | ||
) |
Definition at line 2455 of file kaldi-matrix.cc.
References rnnlm::i, rnnlm::j, KALDI_SWAP4, KALDI_WARN, kaldi::MachineIsLittleEndian(), MatrixBase< Real >::NumCols(), MatrixBase< Real >::NumRows(), MatrixBase< Real >::RowData(), and kaldi::WriteSphinx().
Referenced by main().