29 using namespace kaldi;
69 bool truncate = (
RandInt(0, 1) == 0);
72 if (truncate && (
RandInt(0, 1) == 0)) {
77 extra_error = -0.01 * (
RandInt(0, 1) == 0 ? 1.0 : -1.0);
96 max_expected_error = fabs(extra_error) + headroom * 0.5 *
100 diff_min > -1.0 * max_expected_error);
124 bool truncate = (
RandInt(0, 1) == 0);
127 if (truncate && (
RandInt(0, 1) == 0)) {
132 extra_error = -0.01 * (
RandInt(0, 1) == 0 ? 1.0 : -1.0);
151 max_expected_error = fabs(extra_error) + headroom * 0.5 *
155 diff_min > -1.0 * max_expected_error);
170 CuDevice::Instantiate().SelectGpuId(
"yes");
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void CuCompressedMatrixTestSign()
void AddMat(Real alpha, const CuMatrixBase< Real > &A, MatrixTransposeType trans=kNoTrans)
*this += alpha * A
This class represents a matrix that's stored on the GPU if we have one, and in memory if not...
void Min(const CuMatrixBase< Real > &A)
Do, elementwise, *this = min(*this, A).
void SetVerboseLevel(int32 i)
This should be rarely used, except by programs using Kaldi as library; command-line programs set the ...
void Max(const CuMatrixBase< Real > &A)
Do, elementwise, *this = max(*this, A).
virtual void CopyFromMat(const CuMatrixBase< BaseFloat > &mat)=0
Sets *this to an appropriately compressed copy of 'mat', which includes resizing *this.
void Heaviside(const CuMatrixBase< Real > &src)
Set each element to the Heaviside function of the corresponding element of "src", which we define as ...
void CuCompressedMatrixTestSymmetric()
void CuCompressedMatrixTestNonnegative()
#define KALDI_ASSERT(cond)
static void AssertEqual(float a, float b, float relative_tolerance=0.001)
assert abs(a - b) <= relative_tolerance * (abs(a)+abs(b))
Class CuCompressedMatrixBase is an abstract base class that allows you to compress a matrix of type C...
CuCompressedMatrixBase * NewCuCompressedMatrix(CuCompressedMatrixType t, BaseFloat range, bool truncat)
This function allocates a new CuCompressedMatrix with type determined by t, and with the 'range' and ...
int32 RandInt(int32 min_val, int32 max_val, struct RandomState *state)
virtual void CopyToMat(CuMatrixBase< BaseFloat > *mat) const =0
Copies the contents of *this to 'mat', which should be correctly sized beforehand.