Public Member Functions | |
DiscriminativeComputation (const DiscriminativeOptions &opts, const TransitionModel &tmodel, const CuVectorBase< BaseFloat > &log_priors, const DiscriminativeSupervision &supervision, const CuMatrixBase< BaseFloat > &nnet_output, DiscriminativeObjectiveInfo *stats, CuMatrixBase< BaseFloat > *nnet_output_deriv, CuMatrixBase< BaseFloat > *xent_output_deriv) | |
void | Compute () |
Private Types | |
typedef Lattice::Arc | Arc |
typedef Arc::StateId | StateId |
Private Member Functions | |
double | ComputeObjfAndDeriv (Posterior *post, Posterior *xent_post) |
void | LookupNnetOutput (std::vector< Int32Pair > *requested_indexes, std::vector< BaseFloat > *answers) const |
void | ConvertAnswersToLogLike (const std::vector< Int32Pair > &requested_indexes, std::vector< BaseFloat > *answers) const |
void | ProcessPosteriors (const Posterior &post, CuMatrixBase< BaseFloat > *output_deriv_temp, double *tot_num_post=NULL, double *tot_den_post=NULL) const |
Static Private Member Functions | |
static size_t | LatticeAcousticRescore (const std::vector< BaseFloat > &answers, size_t index, Lattice *lat) |
static Int32Pair | MakePair (int32 first, int32 second) |
Private Attributes | |
const DiscriminativeOptions & | opts_ |
const TransitionModel & | tmodel_ |
const CuVectorBase< BaseFloat > & | log_priors_ |
const DiscriminativeSupervision & | supervision_ |
const CuMatrixBase< BaseFloat > & | nnet_output_ |
DiscriminativeObjectiveInfo * | stats_ |
CuMatrixBase< BaseFloat > * | nnet_output_deriv_ |
CuMatrixBase< BaseFloat > * | xent_output_deriv_ |
Lattice | den_lat_ |
std::vector< int32 > | silence_phones_ |
Definition at line 80 of file discriminative-training.cc.
|
private |
Definition at line 81 of file discriminative-training.cc.
|
private |
Definition at line 82 of file discriminative-training.cc.
DiscriminativeComputation | ( | const DiscriminativeOptions & | opts, |
const TransitionModel & | tmodel, | ||
const CuVectorBase< BaseFloat > & | log_priors, | ||
const DiscriminativeSupervision & | supervision, | ||
const CuMatrixBase< BaseFloat > & | nnet_output, | ||
DiscriminativeObjectiveInfo * | stats, | ||
CuMatrixBase< BaseFloat > * | nnet_output_deriv, | ||
CuMatrixBase< BaseFloat > * | xent_output_deriv | ||
) |
Definition at line 181 of file discriminative-training.cc.
References DiscriminativeSupervision::den_lat, DiscriminativeComputation::den_lat_, KALDI_ERR, DiscriminativeComputation::opts_, DiscriminativeComputation::silence_phones_, DiscriminativeOptions::silence_phones_str, and kaldi::SplitStringToIntegers().
void Compute | ( | ) |
Definition at line 353 of file discriminative-training.cc.
References DiscriminativeObjectiveInfo::AccumulateGradients(), DiscriminativeObjectiveInfo::AccumulateOutput(), DiscriminativeObjectiveInfo::Add(), CuVectorBase< Real >::AddDiagMat2(), CuMatrixBase< Real >::ApplyExp(), DiscriminativeOptions::boost, DiscriminativeComputation::ComputeObjfAndDeriv(), DiscriminativeComputation::ConvertAnswersToLogLike(), DiscriminativeOptions::criterion, DiscriminativeComputation::den_lat_, DiscriminativeSupervision::frames_per_sequence, kaldi::GetVerboseLevel(), DiscriminativeObjectiveInfo::gradients, rnnlm::i, KALDI_ASSERT, KALDI_LOG, KALDI_WARN, kaldi::kNoTrans, kaldi::kTrans, DiscriminativeOptions::l2_regularize, DiscriminativeComputation::LatticeAcousticRescore(), kaldi::LatticeBoost(), DiscriminativeComputation::log_priors_, DiscriminativeComputation::LookupNnetOutput(), DiscriminativeComputation::nnet_output_, DiscriminativeComputation::nnet_output_deriv_, DiscriminativeSupervision::num_ali, DiscriminativeSupervision::num_sequences, DiscriminativeComputation::opts_, DiscriminativeObjectiveInfo::output, DiscriminativeObjectiveInfo::Print(), DiscriminativeObjectiveInfo::PrintAll(), DiscriminativeComputation::ProcessPosteriors(), DiscriminativeObjectiveInfo::Reset(), DiscriminativeComputation::silence_phones_, DiscriminativeComputation::stats_, DiscriminativeComputation::supervision_, DiscriminativeComputation::tmodel_, DiscriminativeObjectiveInfo::tot_den_count, DiscriminativeObjectiveInfo::tot_l2_term, DiscriminativeObjectiveInfo::tot_num_count, DiscriminativeObjectiveInfo::tot_num_objf, DiscriminativeObjectiveInfo::tot_objf, DiscriminativeObjectiveInfo::tot_t, DiscriminativeObjectiveInfo::tot_t_weighted, DiscriminativeObjectiveInfo::TotalObjf(), kaldi::TraceMatMat(), DiscriminativeSupervision::weight, and DiscriminativeComputation::xent_output_deriv_.
Referenced by kaldi::discriminative::ComputeDiscriminativeObjfAndDeriv().
Definition at line 512 of file discriminative-training.cc.
References kaldi::AlignmentToPosterior(), kaldi::ConvertPosteriorToPdfs(), DiscriminativeOptions::criterion, DiscriminativeComputation::den_lat_, DiscriminativeOptions::drop_frames, KALDI_ERR, kaldi::LatticeForwardBackwardMmi(), kaldi::LatticeForwardBackwardMpeVariants(), DiscriminativeSupervision::num_ali, DiscriminativeOptions::one_silence_class, DiscriminativeComputation::opts_, DiscriminativeComputation::silence_phones_, DiscriminativeComputation::supervision_, and DiscriminativeComputation::tmodel_.
Referenced by DiscriminativeComputation::Compute().
|
private |
Definition at line 263 of file discriminative-training.cc.
References DiscriminativeOptions::acoustic_scale, KALDI_ASSERT, KALDI_ISINF, KALDI_ISNAN, KALDI_WARN, kaldi::Log(), DiscriminativeComputation::log_priors_, and DiscriminativeComputation::opts_.
Referenced by DiscriminativeComputation::Compute().
|
staticprivate |
Definition at line 300 of file discriminative-training.cc.
References LatticeWeightTpl< FloatType >::SetValue2(), and LatticeWeightTpl< BaseFloat >::Zero().
Referenced by DiscriminativeComputation::Compute().
|
private |
Definition at line 206 of file discriminative-training.cc.
References DiscriminativeOptions::criterion, DiscriminativeComputation::den_lat_, DiscriminativeSupervision::frames_per_sequence, KALDI_ASSERT, kaldi::LatticeStateTimes(), DiscriminativeComputation::MakePair(), DiscriminativeComputation::nnet_output_, DiscriminativeSupervision::num_ali, DiscriminativeSupervision::num_sequences, TransitionModel::NumPdfs(), DiscriminativeComputation::opts_, DiscriminativeComputation::supervision_, DiscriminativeComputation::tmodel_, and TransitionModel::TransitionIdToPdf().
Referenced by DiscriminativeComputation::Compute().
Definition at line 173 of file discriminative-training.cc.
References Int32Pair::first, and Int32Pair::second.
Referenced by DiscriminativeComputation::LookupNnetOutput(), and DiscriminativeComputation::ProcessPosteriors().
|
private |
Definition at line 326 of file discriminative-training.cc.
References CuMatrixBase< Real >::AddElements(), DiscriminativeSupervision::frames_per_sequence, rnnlm::j, DiscriminativeComputation::MakePair(), DiscriminativeSupervision::num_sequences, DiscriminativeComputation::supervision_, and DiscriminativeSupervision::weight.
Referenced by DiscriminativeComputation::Compute().
|
private |
Definition at line 138 of file discriminative-training.cc.
Referenced by DiscriminativeComputation::Compute(), DiscriminativeComputation::ComputeObjfAndDeriv(), DiscriminativeComputation::DiscriminativeComputation(), and DiscriminativeComputation::LookupNnetOutput().
|
private |
Definition at line 116 of file discriminative-training.cc.
Referenced by DiscriminativeComputation::Compute(), and DiscriminativeComputation::ConvertAnswersToLogLike().
|
private |
Definition at line 121 of file discriminative-training.cc.
Referenced by DiscriminativeComputation::Compute(), and DiscriminativeComputation::LookupNnetOutput().
|
private |
Definition at line 129 of file discriminative-training.cc.
Referenced by DiscriminativeComputation::Compute().
|
private |
Definition at line 111 of file discriminative-training.cc.
Referenced by DiscriminativeComputation::Compute(), DiscriminativeComputation::ComputeObjfAndDeriv(), DiscriminativeComputation::ConvertAnswersToLogLike(), DiscriminativeComputation::DiscriminativeComputation(), and DiscriminativeComputation::LookupNnetOutput().
|
private |
Definition at line 142 of file discriminative-training.cc.
Referenced by DiscriminativeComputation::Compute(), DiscriminativeComputation::ComputeObjfAndDeriv(), and DiscriminativeComputation::DiscriminativeComputation().
|
private |
Definition at line 126 of file discriminative-training.cc.
Referenced by DiscriminativeComputation::Compute().
|
private |
Definition at line 118 of file discriminative-training.cc.
Referenced by DiscriminativeComputation::Compute(), DiscriminativeComputation::ComputeObjfAndDeriv(), DiscriminativeComputation::LookupNnetOutput(), and DiscriminativeComputation::ProcessPosteriors().
|
private |
Definition at line 112 of file discriminative-training.cc.
Referenced by DiscriminativeComputation::Compute(), DiscriminativeComputation::ComputeObjfAndDeriv(), and DiscriminativeComputation::LookupNnetOutput().
|
private |
Definition at line 135 of file discriminative-training.cc.
Referenced by DiscriminativeComputation::Compute().