cu-math.cc File Reference
Include dependency graph for cu-math.cc:

Go to the source code of this file.

Namespaces

 kaldi
 This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for mispronunciations detection tasks, the reference:
 
 kaldi::cu
 

Functions

template<typename Real >
void RegularizeL1 (CuMatrixBase< Real > *weight, CuMatrixBase< Real > *gradient, Real l1_penalty, Real learning_rate)
 RegularizeL1 is a gradient step with l1 regularization added to the gradient. More...
 
template<typename Real >
void Randomize (const CuMatrixBase< Real > &src, const CuArray< int32 > &copy_from_idx, CuMatrixBase< Real > *tgt)
 Copies a permutation of src into tgt. More...
 
template<typename Real >
void Splice (const CuMatrixBase< Real > &src, const CuArray< int32 > &frame_offsets, CuMatrixBase< Real > *tgt)
 Splice concatenates frames of src as specified in frame_offsets into tgt. More...
 
template<typename Real >
void Copy (const CuMatrixBase< Real > &src, const CuArray< int32 > &copy_from_indices, CuMatrixBase< Real > *tgt)
 Copies elements from src into tgt as given by copy_from_indices. More...
 
template<typename Real >
void EnsureNonzero (const CuMatrixBase< Real > &src, Real epsilon, CuMatrixBase< Real > *dest)
 This function requires that src and dest have the same dimension and epsilon > 0. More...
 
template void RegularizeL1 (CuMatrixBase< float > *weight, CuMatrixBase< float > *grad, float l1, float lr)
 
template void RegularizeL1 (CuMatrixBase< double > *weight, CuMatrixBase< double > *grad, double l1, double lr)
 
template void Splice (const CuMatrixBase< float > &src, const CuArray< int32 > &frame_offsets, CuMatrixBase< float > *tgt)
 
template void Splice (const CuMatrixBase< double > &src, const CuArray< int32 > &frame_offsets, CuMatrixBase< double > *tgt)
 
template void Copy (const CuMatrixBase< float > &src, const CuArray< int32 > &copy_from_indices, CuMatrixBase< float > *tgt)
 
template void Copy (const CuMatrixBase< double > &src, const CuArray< int32 > &copy_from_indices, CuMatrixBase< double > *tgt)
 
template void Randomize (const CuMatrixBase< float > &src, const CuArray< int32 > &copy_from_idx, CuMatrixBase< float > *tgt)
 
template void Randomize (const CuMatrixBase< double > &src, const CuArray< int32 > &copy_from_idx, CuMatrixBase< double > *tgt)
 
template<typename Real >
void NormalizePerRow (const CuMatrixBase< Real > &in, const Real target_rms, const bool add_log_stddev, CuMatrixBase< Real > *out)
 Normalize nonlinearity modifies the vector of activations by scaling it so that the root-mean-square equals 1.0. More...
 
template void NormalizePerRow (const CuMatrixBase< float > &in, const float target_rms, const bool add_log_stddev, CuMatrixBase< float > *out)
 
template void NormalizePerRow (const CuMatrixBase< double > &in, const double target_rms, const bool add_log_stddev, CuMatrixBase< double > *out)
 
template<typename Real >
void DiffNormalizePerRow (const CuMatrixBase< Real > &in_value, const CuMatrixBase< Real > &out_deriv, const Real target_rms, const bool add_log_stddev, CuMatrixBase< Real > *in_deriv)
 
template void DiffNormalizePerRow (const CuMatrixBase< float > &in_value, const CuMatrixBase< float > &out_deriv, const float target_rms, const bool add_log_stddev, CuMatrixBase< float > *in_deriv)
 
template void DiffNormalizePerRow (const CuMatrixBase< double > &in_value, const CuMatrixBase< double > &out_deriv, const double target_rms, const bool add_log_stddev, CuMatrixBase< double > *in_deriv)
 
template<typename Real >
static Real ScalarSigmoid (Real a)
 
template<typename Real >
static Real ScalarTanh (Real a)
 
template<typename Real >
void CpuComputeLstmNonlinearity (const MatrixBase< Real > &input_mat, const MatrixBase< Real > &params_mat, MatrixBase< Real > *output)
 
template<typename Real >
void ComputeLstmNonlinearity (const CuMatrixBase< Real > &input, const CuMatrixBase< Real > &params, CuMatrixBase< Real > *output)
 this is a special-purpose function used by class LstmNonlinearityComponent, to do its forward propagation. More...
 
template void CpuComputeLstmNonlinearity (const MatrixBase< float > &input_mat, const MatrixBase< float > &params_mat, MatrixBase< float > *output)
 
template void CpuComputeLstmNonlinearity (const MatrixBase< double > &input_mat, const MatrixBase< double > &params_mat, MatrixBase< double > *output)
 
template void ComputeLstmNonlinearity (const CuMatrixBase< float > &input, const CuMatrixBase< float > &params, CuMatrixBase< float > *output)
 
template void ComputeLstmNonlinearity (const CuMatrixBase< double > &input, const CuMatrixBase< double > &params, CuMatrixBase< double > *output)
 
template<typename Real >
void CpuBackpropLstmNonlinearity (const MatrixBase< Real > &input, const MatrixBase< Real > &params, const MatrixBase< Real > &output_deriv, const MatrixBase< double > &deriv_sum_in, const VectorBase< Real > &self_repair_config, double count_in, MatrixBase< Real > *input_deriv, MatrixBase< Real > *params_deriv, MatrixBase< double > *value_sum_out, MatrixBase< double > *deriv_sum_out, MatrixBase< Real > *self_repair_sum_out)
 
template<typename Real >
void BackpropLstmNonlinearity (const CuMatrixBase< Real > &input, const CuMatrixBase< Real > &params, const CuMatrixBase< Real > &output_deriv, const CuMatrixBase< double > &deriv_sum_in, const CuVectorBase< Real > &self_repair_config, double count_in, CuMatrixBase< Real > *input_deriv, CuMatrixBase< Real > *params_deriv, CuMatrixBase< double > *value_sum_out, CuMatrixBase< double > *deriv_sum_out, CuMatrixBase< Real > *self_repair_sum_out)
 This function does the 'backward' pass corresponding to the function ComputeLstmNonlinearity. More...
 
template<typename Real >
void EnsureNonzero (const CuVectorBase< Real > &src, Real epsilon, CuVectorBase< Real > *dest)
 Vector version of EnsureNonzero, see matrix version for documentation. More...
 
template void EnsureNonzero (const CuMatrixBase< float > &src, float epsilon, CuMatrixBase< float > *dest)
 
template void EnsureNonzero (const CuMatrixBase< double > &src, double epsilon, CuMatrixBase< double > *dest)
 
template void EnsureNonzero (const CuVectorBase< float > &src, float epsilon, CuVectorBase< float > *dest)
 
template void EnsureNonzero (const CuVectorBase< double > &src, double epsilon, CuVectorBase< double > *dest)
 
template void CpuBackpropLstmNonlinearity (const MatrixBase< float > &input, const MatrixBase< float > &params, const MatrixBase< float > &output_deriv, const MatrixBase< double > &deriv_sum_in, const VectorBase< float > &self_repair_config, double count_in, MatrixBase< float > *input_deriv, MatrixBase< float > *params_deriv, MatrixBase< double > *value_sum_out, MatrixBase< double > *deriv_sum_out, MatrixBase< float > *self_repair_sum_out)
 
template void CpuBackpropLstmNonlinearity (const MatrixBase< double > &input, const MatrixBase< double > &params, const MatrixBase< double > &output_deriv, const MatrixBase< double > &deriv_sum_in, const VectorBase< double > &self_repair_config, double count_in, MatrixBase< double > *input_deriv, MatrixBase< double > *params_deriv, MatrixBase< double > *value_sum_out, MatrixBase< double > *deriv_sum_out, MatrixBase< double > *self_repair_sum_out)
 
template void BackpropLstmNonlinearity (const CuMatrixBase< float > &input, const CuMatrixBase< float > &params, const CuMatrixBase< float > &output_deriv, const CuMatrixBase< double > &deriv_sum_in, const CuVectorBase< float > &self_repair_config, double count_in, CuMatrixBase< float > *input_deriv, CuMatrixBase< float > *params_deriv, CuMatrixBase< double > *value_sum_out, CuMatrixBase< double > *deriv_sum_out, CuMatrixBase< float > *self_repair_sum_out)
 
template void BackpropLstmNonlinearity (const CuMatrixBase< double > &input, const CuMatrixBase< double > &params, const CuMatrixBase< double > &output_deriv, const CuMatrixBase< double > &deriv_sum_in, const CuVectorBase< double > &self_repair_config, double count_in, CuMatrixBase< double > *input_deriv, CuMatrixBase< double > *params_deriv, CuMatrixBase< double > *value_sum_out, CuMatrixBase< double > *deriv_sum_out, CuMatrixBase< double > *self_repair_sum_out)