38 int32 rows = M.
NumRows(), cols = M.NumCols(), rc_min = std::min(rows, cols);
42 M.DestructiveSvd(&s, &U, &Vt);
51 KALDI_LOG <<
"For component " <<
c_ <<
" of dimension " << rows
52 <<
" x " << cols <<
", reduced rank from " 53 << rc_min <<
" to " << d <<
", SVD sum reduced from " 54 << old_svd_sum <<
" to " << new_svd_sum;
85 BaseFloat x = (-b - sqrt(b * b - 4 * a * c)) / (2.0 * a);
105 if (dynamic_cast<AffineComponent*>(&(nnet->
GetComponent(c))) != NULL)
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
const Component & GetComponent(int32 c) const
virtual void SetParams(const VectorBase< BaseFloat > &bias, const MatrixBase< BaseFloat > &linear)
void Run(C *c)
This function takes ownership of the pointer "c", and will delete it in the same sequence as Run was ...
void LimitRankParallel(const NnetLimitRankOpts &opts, Nnet *nnet)
This function limits the rank of each affine transform in the neural net, by zeroing out the smallest...
LimitRankClass(const NnetLimitRankOpts &opts, int32 c, Nnet *nnet)
const CuVector< BaseFloat > & BiasParams()
void Resize(MatrixIndexT length, MatrixResizeType resize_type=kSetZero)
Set vector to a specified size (can be zero).
const NnetLimitRankOpts & opts_
int32 NumComponents() const
Returns number of components– think of this as similar to # of layers, but e.g.
int32 GetRetainedDim(int32 rows, int32 cols)
Real Sum() const
Returns sum of the elements.
void MulRowsVec(const VectorBase< Real > &scale)
Equivalent to (*this) = diag(scale) * (*this).
A class representing a vector.
#define KALDI_ASSERT(cond)
MatrixIndexT NumRows() const
Returns number of rows (or zero for empty matrix).
BaseFloat parameter_proportion
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).
const CuMatrix< BaseFloat > & LinearParams()
void SortSvd(VectorBase< Real > *s, MatrixBase< Real > *U, MatrixBase< Real > *Vt, bool sort_on_absolute_value)
Function to ensure that SVD is sorted.