For each frame, judge: More...
Classes | |
struct | FrameInfo |
Public Member Functions | |
DiscriminativeExampleSplitter (const SplitDiscriminativeExampleConfig &config, const TransitionModel &tmodel, const DiscriminativeNnetExample &eg, std::vector< DiscriminativeNnetExample > *egs_out) | |
void | Excise (SplitExampleStats *stats) |
void | Split (SplitExampleStats *stats) |
Private Types | |
typedef LatticeArc | Arc |
typedef Arc::StateId | StateId |
typedef Arc::Label | Label |
Private Member Functions | |
void | PrepareLattice (bool first_time) |
void | CollapseTransitionIds () |
bool | ComputeFrameInfo () |
void | OutputOneSplit (int32 seg_begin, int32 seg_end) |
void | DoSplit (SplitExampleStats *stats) |
void | DoExcise (SplitExampleStats *stats) |
int32 | NumFrames () const |
int32 | RightContext () |
void | CreateOutputLattice (int32 seg_begin, int32 seg_end, CompactLattice *clat_out) |
StateId | GetOutputStateId (StateId s, unordered_map< StateId, StateId > *state_map, Lattice *lat_out) |
Static Private Member Functions | |
static void | RemoveAllOutputSymbols (Lattice *lat) |
Private Attributes | |
const SplitDiscriminativeExampleConfig & | config_ |
const TransitionModel & | tmodel_ |
const DiscriminativeNnetExample & | eg_ |
std::vector< DiscriminativeNnetExample > * | egs_out_ |
Lattice | lat_ |
std::vector< FrameInfo > | frame_info_ |
std::vector< int32 > | state_times_ |
For each frame, judge:
Time taken to process segment of a certain length: [must be sub-linear.] [use quadratic function that's max at specified segment length and zero at zero.]
No penalty for processing frames we don't need to process (already implicit in segment-processing time above.)
Penalty for splitting where we should not split. [Make it propto log(#paths).]
Definition at line 100 of file nnet-example-functions.cc.
|
private |
Definition at line 134 of file nnet-example-functions.cc.
|
private |
Definition at line 136 of file nnet-example-functions.cc.
|
private |
Definition at line 135 of file nnet-example-functions.cc.
|
inline |
Definition at line 102 of file nnet-example-functions.cc.
|
private |
Definition at line 236 of file nnet-example-functions.cc.
References count, KALDI_ASSERT, DiscriminativeExampleSplitter::lat_, kaldi::LatticeStateTimes(), DiscriminativeExampleSplitter::tmodel_, and TransitionModel::TransitionIdToPdf().
Referenced by DiscriminativeExampleSplitter::PrepareLattice().
|
private |
Definition at line 299 of file nnet-example-functions.cc.
References DiscriminativeExampleSplitter::FrameInfo::can_excise_frame, DiscriminativeExampleSplitter::config_, SplitDiscriminativeExampleConfig::criterion, DiscriminativeExampleSplitter::FrameInfo::den_pdf_count, DiscriminativeExampleSplitter::FrameInfo::den_state_count, SplitDiscriminativeExampleConfig::drop_frames, DiscriminativeExampleSplitter::eg_, DiscriminativeExampleSplitter::FrameInfo::end_state, DiscriminativeExampleSplitter::frame_info_, rnnlm::i, KALDI_ASSERT, DiscriminativeExampleSplitter::lat_, kaldi::LatticeStateTimes(), DiscriminativeExampleSplitter::FrameInfo::multiple_transition_ids, DiscriminativeExampleSplitter::FrameInfo::nonzero_derivative, DiscriminativeNnetExample::num_ali, DiscriminativeExampleSplitter::FrameInfo::num_den_overlap, DiscriminativeExampleSplitter::NumFrames(), DiscriminativeExampleSplitter::FrameInfo::start_state, DiscriminativeExampleSplitter::state_times_, DiscriminativeExampleSplitter::tmodel_, and TransitionModel::TransitionIdToPdf().
Referenced by DiscriminativeExampleSplitter::Excise(), and DiscriminativeExampleSplitter::Split().
|
private |
Definition at line 644 of file nnet-example-functions.cc.
References fst::ConvertLattice(), DiscriminativeExampleSplitter::frame_info_, DiscriminativeExampleSplitter::GetOutputStateId(), KALDI_ASSERT, DiscriminativeExampleSplitter::lat_, DiscriminativeExampleSplitter::NumFrames(), LatticeWeightTpl< BaseFloat >::One(), DiscriminativeExampleSplitter::RemoveAllOutputSymbols(), DiscriminativeExampleSplitter::FrameInfo::start_state, and DiscriminativeExampleSplitter::state_times_.
Referenced by DiscriminativeExampleSplitter::OutputOneSplit(), and DiscriminativeExampleSplitter::RightContext().
|
private |
Definition at line 398 of file nnet-example-functions.cc.
References DiscriminativeNnetExample::Check(), fst::ConvertLattice(), VectorBase< Real >::CopyFromVec(), DiscriminativeNnetExample::den_lat, DiscriminativeExampleSplitter::eg_, DiscriminativeExampleSplitter::egs_out_, DiscriminativeExampleSplitter::frame_info_, rnnlm::i, DiscriminativeNnetExample::input_frames, KALDI_ASSERT, KALDI_WARN, DiscriminativeExampleSplitter::lat_, DiscriminativeNnetExample::left_context, SplitExampleStats::longest_segment_after_excise, DiscriminativeNnetExample::num_ali, SplitExampleStats::num_frames_kept_after_excise, MatrixBase< Real >::NumCols(), DiscriminativeExampleSplitter::NumFrames(), DiscriminativeExampleSplitter::RemoveAllOutputSymbols(), Matrix< Real >::Resize(), DiscriminativeExampleSplitter::RightContext(), DiscriminativeNnetExample::spk_info, DiscriminativeExampleSplitter::state_times_, and DiscriminativeNnetExample::weight.
Referenced by DiscriminativeExampleSplitter::Excise().
|
private |
Definition at line 516 of file nnet-example-functions.cc.
References DiscriminativeExampleSplitter::FrameInfo::den_state_count, DiscriminativeExampleSplitter::egs_out_, DiscriminativeExampleSplitter::frame_info_, SplitExampleStats::longest_lattice, SplitExampleStats::longest_segment_after_split, DiscriminativeExampleSplitter::FrameInfo::nonzero_derivative, SplitExampleStats::num_frames_kept_after_split, SplitExampleStats::num_frames_must_keep, SplitExampleStats::num_frames_orig, SplitExampleStats::num_kept_segments, SplitExampleStats::num_lattices, SplitExampleStats::num_segments, DiscriminativeExampleSplitter::NumFrames(), and DiscriminativeExampleSplitter::OutputOneSplit().
Referenced by DiscriminativeExampleSplitter::Split().
|
inline |
Definition at line 109 of file nnet-example-functions.cc.
References DiscriminativeNnetExample::Check(), DiscriminativeExampleSplitter::ComputeFrameInfo(), DiscriminativeExampleSplitter::config_, DiscriminativeExampleSplitter::DoExcise(), DiscriminativeExampleSplitter::eg_, DiscriminativeExampleSplitter::egs_out_, SplitDiscriminativeExampleConfig::excise, and DiscriminativeExampleSplitter::PrepareLattice().
Referenced by kaldi::nnet2::ExciseDiscriminativeExample().
|
private |
Definition at line 635 of file nnet-example-functions.cc.
Referenced by DiscriminativeExampleSplitter::CreateOutputLattice(), and DiscriminativeExampleSplitter::RightContext().
|
inlineprivate |
Definition at line 159 of file nnet-example-functions.cc.
References DiscriminativeExampleSplitter::eg_, and DiscriminativeNnetExample::num_ali.
Referenced by DiscriminativeExampleSplitter::ComputeFrameInfo(), DiscriminativeExampleSplitter::CreateOutputLattice(), DiscriminativeExampleSplitter::DoExcise(), DiscriminativeExampleSplitter::DoSplit(), DiscriminativeExampleSplitter::OutputOneSplit(), and DiscriminativeExampleSplitter::RightContext().
Definition at line 596 of file nnet-example-functions.cc.
References DiscriminativeNnetExample::Check(), DiscriminativeExampleSplitter::CreateOutputLattice(), DiscriminativeNnetExample::den_lat, DiscriminativeExampleSplitter::eg_, DiscriminativeExampleSplitter::egs_out_, DiscriminativeNnetExample::input_frames, KALDI_ASSERT, DiscriminativeNnetExample::left_context, DiscriminativeNnetExample::num_ali, MatrixBase< Real >::NumCols(), DiscriminativeExampleSplitter::NumFrames(), MatrixBase< Real >::Range(), DiscriminativeExampleSplitter::RightContext(), DiscriminativeNnetExample::spk_info, and DiscriminativeNnetExample::weight.
Referenced by DiscriminativeExampleSplitter::DoSplit().
|
private |
Definition at line 263 of file nnet-example-functions.cc.
References SplitDiscriminativeExampleConfig::collapse_transition_ids, DiscriminativeExampleSplitter::CollapseTransitionIds(), DiscriminativeExampleSplitter::config_, fst::ConvertLattice(), SplitDiscriminativeExampleConfig::criterion, DiscriminativeNnetExample::den_lat, SplitDiscriminativeExampleConfig::determinize, DiscriminativeExampleSplitter::eg_, DiscriminativeExampleSplitter::lat_, and SplitDiscriminativeExampleConfig::minimize.
Referenced by DiscriminativeExampleSplitter::Excise(), and DiscriminativeExampleSplitter::Split().
|
staticprivate |
Definition at line 623 of file nnet-example-functions.cc.
Referenced by DiscriminativeExampleSplitter::CreateOutputLattice(), and DiscriminativeExampleSplitter::DoExcise().
|
inlineprivate |
Definition at line 161 of file nnet-example-functions.cc.
References DiscriminativeExampleSplitter::CreateOutputLattice(), DiscriminativeExampleSplitter::eg_, DiscriminativeExampleSplitter::GetOutputStateId(), DiscriminativeNnetExample::input_frames, DiscriminativeNnetExample::left_context, DiscriminativeExampleSplitter::NumFrames(), and MatrixBase< Real >::NumRows().
Referenced by DiscriminativeExampleSplitter::DoExcise(), and DiscriminativeExampleSplitter::OutputOneSplit().
|
inline |
Definition at line 121 of file nnet-example-functions.cc.
References DiscriminativeNnetExample::Check(), DiscriminativeExampleSplitter::ComputeFrameInfo(), DiscriminativeExampleSplitter::config_, DiscriminativeExampleSplitter::DoSplit(), DiscriminativeExampleSplitter::eg_, DiscriminativeExampleSplitter::egs_out_, DiscriminativeExampleSplitter::PrepareLattice(), and SplitDiscriminativeExampleConfig::split.
Referenced by kaldi::nnet2::SplitDiscriminativeExample().
|
private |
Definition at line 213 of file nnet-example-functions.cc.
Referenced by DiscriminativeExampleSplitter::ComputeFrameInfo(), DiscriminativeExampleSplitter::Excise(), DiscriminativeExampleSplitter::PrepareLattice(), and DiscriminativeExampleSplitter::Split().
|
private |
Definition at line 215 of file nnet-example-functions.cc.
Referenced by DiscriminativeExampleSplitter::ComputeFrameInfo(), DiscriminativeExampleSplitter::DoExcise(), DiscriminativeExampleSplitter::Excise(), DiscriminativeExampleSplitter::NumFrames(), DiscriminativeExampleSplitter::OutputOneSplit(), DiscriminativeExampleSplitter::PrepareLattice(), DiscriminativeExampleSplitter::RightContext(), and DiscriminativeExampleSplitter::Split().
|
private |
|
private |
Definition at line 223 of file nnet-example-functions.cc.
Referenced by DiscriminativeExampleSplitter::ComputeFrameInfo(), DiscriminativeExampleSplitter::CreateOutputLattice(), DiscriminativeExampleSplitter::DoExcise(), and DiscriminativeExampleSplitter::DoSplit().
|
private |
Definition at line 218 of file nnet-example-functions.cc.
Referenced by DiscriminativeExampleSplitter::CollapseTransitionIds(), DiscriminativeExampleSplitter::ComputeFrameInfo(), DiscriminativeExampleSplitter::CreateOutputLattice(), DiscriminativeExampleSplitter::DoExcise(), and DiscriminativeExampleSplitter::PrepareLattice().
|
private |
Definition at line 226 of file nnet-example-functions.cc.
Referenced by DiscriminativeExampleSplitter::ComputeFrameInfo(), DiscriminativeExampleSplitter::CreateOutputLattice(), and DiscriminativeExampleSplitter::DoExcise().
|
private |
Definition at line 214 of file nnet-example-functions.cc.
Referenced by DiscriminativeExampleSplitter::CollapseTransitionIds(), and DiscriminativeExampleSplitter::ComputeFrameInfo().