Skip to content

Commit 465b73c

Browse files
author
Tanel Alumäe
committed
Fix nnet3 endpointing to correctly use frame subsampling factor (kaldi-asr#1184)
1 parent 288890c commit 465b73c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/nnet3/online-nnet3-decodable-simple.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class DecodableNnet3SimpleOnline: public DecodableInterface {
102102
/// Indices are one-based! This is for compatibility with OpenFst.
103103
virtual int32 NumIndices() const { return trans_model_.NumTransitionIds(); }
104104

105+
virtual int32 FrameSubsamplingFactor() const { return opts_.frame_subsampling_factor; }
105106
private:
106107

107108
/// If the neural-network outputs for this frame are not cached, it computes

src/online2/online-nnet3-decoding.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ void SingleUtteranceNnet3Decoder::GetBestPath(bool end_of_utterance,
7272

7373
bool SingleUtteranceNnet3Decoder::EndpointDetected(
7474
const OnlineEndpointConfig &config) {
75+
int32 subsample = decodable_.FrameSubsamplingFactor();
7576
return kaldi::EndpointDetected(config, tmodel_,
76-
feature_pipeline_->FrameShiftInSeconds(),
77+
feature_pipeline_->FrameShiftInSeconds() * subsample,
7778
decoder_);
7879
}
7980

0 commit comments

Comments
 (0)