30 std::vector<int32> phones;
35 int32 N = 2 + rand() % 2,
38 std::vector<int32> num_pdf_classes;
42 true, &num_pdf_classes);
51 int32 input_dim = 40, output_dim = trans_model.
NumPdfs();
64 bool binary = (rand() % 2 == 0);
65 std::ostringstream os;
66 am_nnet.
Write(os, binary);
68 std::istringstream is(os.str());
69 am_nnet2.
Read(is, binary);
71 std::ostringstream os2;
72 am_nnet2.
Write(os2, binary);
82 using namespace kaldi;
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.
void Read(std::istream &is, bool binary)
void Write(std::ostream &os, bool binary) const
void Scale(Real alpha)
Multiplies all elements by this constant.
Real Sum() const
Returns sum of the elements.
void SetRandn()
Set vector to random normally-distributed noise.
A class representing a vector.
#define KALDI_ASSERT(cond)
void SetPriors(const VectorBase< BaseFloat > &priors)