63 KALDI_WARN <<
"Removing priors since there is a dimension mismatch after " 64 <<
"changing the nnet: " <<
priors_.Dim() <<
" vs. " 74 KALDI_ERR <<
"Dimension mismatch when setting priors: priors have dim " 75 << priors.
Dim() <<
", model expects " 81 std::ostringstream ostr;
85 ostr <<
"prior-dimension: " <<
priors_.Dim() <<
"\n";
87 ostr <<
"prior-sum: " <<
priors_.Sum() <<
"\n";
88 ostr <<
"prior-min: " <<
priors_.Min() <<
"\n";
89 ostr <<
"prior-max: " <<
priors_.Max() <<
"\n";
91 ostr <<
"# Nnet info follows.\n";
98 KALDI_ERR <<
"Class AmNnetSimple is only intended for a restricted type of " 99 <<
"nnet, and this one does not meet the conditions.";
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Vector< BaseFloat > priors_
int32 InputDim(const std::string &input_name) const
void Write(std::ostream &ostream, bool binary) const
void ReadBasicType(std::istream &is, bool binary, T *t)
ReadBasicType is the name of the read function for bool, integer types, and floating-point types...
void Read(std::istream &is, bool binary)
int32 OutputDim(const std::string &output_name) const
This file contains some miscellaneous functions dealing with class Nnet.
std::string Info() const
returns some human-readable information about the network, mostly for debugging purposes.
void SetPriors(const VectorBase< BaseFloat > &priors)
static void ExpectToken(const std::string &token, const std::string &what_we_are_parsing, const std::string **next_token)
void ComputeSimpleNnetContext(const Nnet &nnet, int32 *left_context, int32 *right_context)
ComputeSimpleNnetContext computes the left-context and right-context of a nnet.
void Read(std::istream &istream, bool binary)
void WriteToken(std::ostream &os, bool binary, const char *token)
The WriteToken functions are for writing nonempty sequences of non-space characters.
MatrixIndexT Dim() const
Returns the dimension of the vector.
void SetNnet(const Nnet &nnet)
bool IsSimpleNnet(const Nnet &nnet)
This function returns true if the nnet has the following properties: It has an output called "output"...
void SetContext()
This function works out the left_context_ and right_context_ variables from the network (it's a rathe...
#define KALDI_ASSERT(cond)
void WriteBasicType(std::ostream &os, bool binary, T t)
WriteBasicType is the name of the write function for bool, integer types, and floating-point types...
Provides a vector abstraction class.
void Write(std::ostream &os, bool binary) const