21 #ifndef KALDI_TRANSFORM_DIFFERENTIABLE_TRANSFORM_H_ 22 #define KALDI_TRANSFORM_DIFFERENTIABLE_TRANSFORM_H_ 33 namespace differentiable_transform {
89 virtual int32 Dim()
const = 0;
181 virtual void TrainingBackward(
195 virtual int32 NumFinalIterations() = 0;
213 virtual void Accumulate(
223 virtual void Estimate(
int32 final_iter) = 0;
237 virtual void TestingAccumulate(
245 virtual void TestingForward(
262 virtual void Write(std::ostream &os,
bool binary)
const = 0;
266 virtual void Read(std::istream &is,
bool binary) = 0;
302 input_deriv->
AddMat(1.0, output_deriv);
312 const Posterior &posteriors)
override { }
332 dim_(other.dim_), num_classes_(other.num_classes_) { }
338 void Write(std::ostream &os,
bool binary)
const override;
340 void Read(std::istream &is,
bool binary)
override;
356 int32 Dim()
const override;
357 int32 SetNumClasses()
const override;
365 virtual void TrainingBackward(
374 virtual int32 NumFinalIterations();
385 void TestingAccumulate(
390 virtual void TestingForward(
395 void Estimate(
int32 final_iter)
override;
403 void Write(std::ostream &os,
bool binary)
const override;
405 void Read(std::istream &is,
bool binary)
override;
421 int32 Dim()
const override;
422 int32 SetNumClasses()
const override;
430 virtual void TrainingBackward(
439 virtual int32 NumFinalIterations();
448 virtual void TestingForward(
453 void Estimate(
int32 final_iter)
override;
461 void Write(std::ostream &os,
bool binary)
const override;
463 void Read(std::istream &is,
bool binary)
override;
478 int32 Dim()
const override;
479 int32 NumClasses()
const override;
489 virtual void TrainingBackward(
510 void Write(std::ostream &os,
bool binary)
const override;
512 void Read(std::istream &is,
bool binary)
override;
514 std::vector<DifferentiableTransform*> transforms_;
526 int32 Dim()
const override;
527 int32 NumClasses()
const override;
537 virtual void TrainingBackward(
552 virtual void TestingForward(
564 void Write(std::ostream &os,
bool binary)
const override;
566 void Read(std::istream &is,
bool binary)
override;
604 int32 Dim()
const override;
605 int32 NumClasses()
const override;
612 virtual void TrainingBackward(
629 void TestingAccumulate(
634 virtual void TestingForward(
645 void Write(std::ostream &os,
bool binary)
const override;
647 void Read(std::istream &is,
bool binary)
override;
688 #endif // KALDI_TRANSFORM_DIFFERENTIABLE_TRANSFORM_H_
void CopyFromMat(const MatrixBase< OtherReal > &src, MatrixTransposeType trans=kNoTrans)
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Base class which provides matrix operations not involving resizing or allocation. ...
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 CopyFromMat(const MatrixBase< OtherReal > &M, MatrixTransposeType trans=kNoTrans)
Copy given matrix. (no resize is done).
std::vector< std::vector< std::pair< int32, BaseFloat > > > Posterior
Posterior is a typedef for storing acoustic-state (actually, transition-id) posteriors over an uttera...
Matrix for CUDA computing.
void Copy(const CuMatrixBase< Real > &src, const CuArray< int32 > ©_from_indices, CuMatrixBase< Real > *tgt)
Copies elements from src into tgt as given by copy_from_indices.