40 && input.
K_.
NumRows() == dim && input.
G_[0].NumRows() == dim+1);
66 old_g_row.CopyRowFromSp(input.
G_[
i],
i);
81 Ki.
AddVec(-1.0, old_g_row);
82 Ki.
AddVec(+1.0, new_g_row);
96 if (output->
Dim() != dim || output->
G_.size() != dim ||
beta_ == 0.0)
97 output->
Init(dim, dim);
98 if (
beta_ == 0.0)
return;
111 WriteToken(os, binary,
"<CompressedAffineXformStats>");
115 WriteToken(os, binary,
"</CompressedAffineXformStats>");
119 ExpectToken(is, binary,
"<CompressedAffineXformStats>");
123 ExpectToken(is, binary,
"</CompressedAffineXformStats>");
133 double raw_trace = Gi.
Trace();
134 double norm_trace = (raw_trace / (beta * dim));
135 (*linearized)(0) = norm_trace;
140 C.
Scale(sqrt(dim / raw_trace));
143 linearized_matrix.CopyFromPacked(C);
152 double norm_trace = linearized(0);
153 double raw_trace = norm_trace * beta * dim;
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void CopyFromVec(const SubVector< OtherReal > &orig)
CopyFromVec just interprets the vector as having the same layout as the packed matrix.
void Write(std::ostream &out, bool binary) const
write to stream.
MatrixIndexT NumCols() const
Returns number of columns (or zero for empty matrix).
void ReadBasicType(std::istream &is, bool binary, T *t)
ReadBasicType is the name of the read function for bool, integer types, and floating-point types...
void Write(std::ostream &os, bool binary) const
void CopyFromMat(const MatrixBase< OtherReal > &M, MatrixTransposeType trans=kNoTrans)
Copy given matrix. (no resize is done).
MatrixIndexT NumRows() const
void Read(std::istream &is, bool binary)
void Read(std::istream &in, bool binary, bool add=false)
read from stream.
void Cholesky(const SpMatrix< Real > &orig)
void ExpectToken(std::istream &is, bool binary, const char *token)
ExpectToken tries to read in the given token, and throws an exception on failure. ...
void AddTp2(const Real alpha, const TpMatrix< Real > &T, MatrixTransposeType transM, const Real beta=0.0)
The following function does: this <– beta*this + alpha * T * T^T.
void WriteToken(std::ostream &os, bool binary, const char *token)
The WriteToken functions are for writing nonempty sequences of non-space characters.
MatrixIndexT NumRows() const
Returns number of rows (or zero for emtpy matrix).
#define KALDI_ASSERT(cond)
MatrixIndexT NumRows() const
Returns number of rows (or zero for empty matrix).
void WriteBasicType(std::ostream &os, bool binary, T t)
WriteBasicType is the name of the write function for bool, integer types, and floating-point types...
void Resize(const MatrixIndexT r, const MatrixIndexT c, MatrixResizeType resize_type=kSetZero, MatrixStrideType stride_type=kDefaultStride)
Sets matrix to a specified size (zero is OK as long as both r and c are zero).
MatrixIndexT NumCols() const
Returns number of columns (or zero for emtpy matrix).
void AddVec(const Real alpha, const VectorBase< OtherReal > &v)
Add vector : *this = *this + alpha * rv (with casting between floats and doubles) ...
void CopyToMat(MatrixBase< Real > *mat, MatrixTransposeType trans=kNoTrans) const
Copies contents to matrix.
Represents a non-allocating general vector which can be defined as a sub-vector of higher-level vecto...
void CopyFromMat(const MatrixBase< Real > &mat, CompressionMethod method=kAutomaticMethod)
This will resize *this and copy the contents of mat to *this.
void CopyRowFromSp(const SpMatrix< OtherReal > &S, MatrixIndexT row)
Extracts a row of the symmetric matrix S.
SubVector< Real > Range(const MatrixIndexT o, const MatrixIndexT l)
Returns a sub-vector of a vector (a range of elements).