32 std::vector<int32> phones;
37 int32 N = 2 + rand() % 2,
40 std::vector<int32> num_pdf_classes;
44 true, &num_pdf_classes);
53 int32 input_dim = 40, output_dim = trans_model.
NumPdfs();
72 int32 num_input_frames = 400;
79 opts, &matrix_feature);
93 int32 t = rand() % num_frames, tid = 1 + rand() % num_tids;
105 using namespace kaldi;
This class takes a Matrix<BaseFloat> and wraps it as an OnlineFeatureInterface: this can be useful wh...
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void ApplyExp()
Apply exponential to each value in vector.
HmmTopology GetDefaultTopology(const std::vector< int32 > &phones_in)
This function returns a HmmTopology object giving a normal 3-state topology, covering all phones in t...
ContextDependency * GenRandContextDependencyLarge(const std::vector< int32 > &phone_ids, int N, int P, bool ensure_all_covered, std::vector< int32 > *hmm_lengths)
GenRandContextDependencyLarge is like GenRandContextDependency but generates a larger tree with speci...
A class for storing topology information for phones.
Nnet * GenRandomNnet(int32 input_dim, int32 output_dim)
This function generates a random neural net, for testing purposes.
This class represents a matrix that's stored on the GPU if we have one, and in memory if not...
virtual int32 NumFramesReady() const
The call NumFramesReady() will return the number of frames currently available for this decodable obj...
int32 NumTransitionIds() const
Returns the total number of transition-ids (note, these are one-based).
void SetRandn()
Sets to random values of a normal distribution.
virtual BaseFloat LogLikelihood(int32 frame, int32 transition_id)
Returns the log likelihood, which will be negated in the decoder.
This Decodable object for class nnet2::AmNnet takes feature input from class OnlineFeatureInterface, unlike, say, class DecodableAmNnet which takes feature input from a matrix.
void Scale(Real alpha)
Multiplies all elements by this constant.
virtual int32 NumFramesReady() const
The call NumFramesReady() will return the number of frames currently available for this decodable obj...
Real Sum() const
Returns sum of the elements.
void SetRandn()
Set vector to random normally-distributed noise.
void UnitTestNnetDecodable()
virtual BaseFloat LogLikelihood(int32 frame, int32 index)
Returns the scaled log likelihood.
A class representing a vector.
#define KALDI_ASSERT(cond)
DecodableAmNnet is a decodable object that decodes with a neural net acoustic model of type AmNnet...
void SetPriors(const VectorBase< BaseFloat > &priors)
int32 max_nnet_batch_size
static bool ApproxEqual(float a, float b, float relative_tolerance=0.001)
return abs(a - b) <= relative_tolerance * (abs(a)+abs(b)).