Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/online2/online-ivector-feature.cc
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ void OnlineSilenceWeighting::GetDeltaWeights(
// in this function is at the decoder frame-rate.
// round up, so we are sure to get weights for at least the frame
// 'num_frames_ready - 1', and maybe one or two frames afterward.
KALDI_ASSERT(num_frames_ready > first_decoder_frame);
int32 fs = frame_subsampling_factor_,
num_decoder_frames_ready = (num_frames_ready - first_decoder_frame + fs - 1) / fs;

Expand Down
8 changes: 8 additions & 0 deletions src/online2/online-ivector-feature.h
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,14 @@ class OnlineSilenceWeighting {
int32 num_frames_ready, int32 first_decoder_frame,
std::vector<std::pair<int32, BaseFloat> > *delta_weights);

// A method for backward compatibility, same as above, but for a single
// utterance.
void GetDeltaWeights(
int32 num_frames_ready,
std::vector<std::pair<int32, BaseFloat> > *delta_weights) {
GetDeltaWeights(num_frames_ready, 0, delta_weights);
}

private:
const TransitionModel &trans_model_;
const OnlineSilenceWeightingConfig &config_;
Expand Down
2 changes: 1 addition & 1 deletion src/online2/online-nnet2-decoding-threaded.cc
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ bool SingleUtteranceNnet2DecoderThreaded::RunNnetEvaluationInternal() {
silence_weighting_mutex_.lock();
std::vector<std::pair<int32, BaseFloat> > delta_weights;
silence_weighting_.GetDeltaWeights(
feature_pipeline_.IvectorFeature()->NumFramesReady(), 0,
feature_pipeline_.IvectorFeature()->NumFramesReady(),
&delta_weights);
silence_weighting_mutex_.unlock();
feature_pipeline_.IvectorFeature()->UpdateFrameWeights(delta_weights);
Expand Down
2 changes: 1 addition & 1 deletion src/online2bin/online2-wav-nnet2-latgen-faster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ int main(int argc, char *argv[]) {
feature_pipeline.IvectorFeature() != NULL) {
silence_weighting.ComputeCurrentTraceback(decoder.Decoder());
silence_weighting.GetDeltaWeights(
feature_pipeline.IvectorFeature()->NumFramesReady(), 0,
feature_pipeline.IvectorFeature()->NumFramesReady(),
&delta_weights);
feature_pipeline.IvectorFeature()->UpdateFrameWeights(
delta_weights);
Expand Down
2 changes: 1 addition & 1 deletion src/online2bin/online2-wav-nnet3-latgen-faster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ int main(int argc, char *argv[]) {
if (silence_weighting.Active() &&
feature_pipeline.IvectorFeature() != NULL) {
silence_weighting.ComputeCurrentTraceback(decoder.Decoder());
silence_weighting.GetDeltaWeights(feature_pipeline.NumFramesReady(), 0,
silence_weighting.GetDeltaWeights(feature_pipeline.NumFramesReady(),
&delta_weights);
feature_pipeline.IvectorFeature()->UpdateFrameWeights(delta_weights);
}
Expand Down
2 changes: 1 addition & 1 deletion src/online2bin/online2-wav-nnet3-latgen-grammar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ int main(int argc, char *argv[]) {
if (silence_weighting.Active() &&
feature_pipeline.IvectorFeature() != NULL) {
silence_weighting.ComputeCurrentTraceback(decoder.Decoder());
silence_weighting.GetDeltaWeights(feature_pipeline.NumFramesReady(), 0,
silence_weighting.GetDeltaWeights(feature_pipeline.NumFramesReady(),
&delta_weights);
feature_pipeline.IvectorFeature()->UpdateFrameWeights(delta_weights);
}
Expand Down