From 45d60ef262fe65fa1a63cbdd7b89658b359f7724 Mon Sep 17 00:00:00 2001 From: l2009312042 Date: Thu, 21 Sep 2023 19:41:10 +0800 Subject: [PATCH] Update conformer.py (#1200) * Update conformer.py * Update zipformer.py fix bug in get_dynamic_dropout_rate --- .../ASR/pruned_transducer_stateless7_streaming/zipformer.py | 2 +- egs/librispeech/ASR/streaming_conformer_ctc/conformer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/egs/librispeech/ASR/pruned_transducer_stateless7_streaming/zipformer.py b/egs/librispeech/ASR/pruned_transducer_stateless7_streaming/zipformer.py index a5c4229598..c7e45564fd 100644 --- a/egs/librispeech/ASR/pruned_transducer_stateless7_streaming/zipformer.py +++ b/egs/librispeech/ASR/pruned_transducer_stateless7_streaming/zipformer.py @@ -865,7 +865,7 @@ def get_dynamic_dropout_rate(self): return final_dropout_rate else: return initial_dropout_rate - ( - initial_dropout_rate * final_dropout_rate + initial_dropout_rate - final_dropout_rate ) * (self.batch_count / warmup_period) def forward( diff --git a/egs/librispeech/ASR/streaming_conformer_ctc/conformer.py b/egs/librispeech/ASR/streaming_conformer_ctc/conformer.py index 5fe92172ee..be6fabf353 100644 --- a/egs/librispeech/ASR/streaming_conformer_ctc/conformer.py +++ b/egs/librispeech/ASR/streaming_conformer_ctc/conformer.py @@ -230,7 +230,7 @@ def train_run_encoder( x, pos_emb, mask=mask, src_key_padding_mask=src_key_padding_mask ) # (T, B, F) else: - x = self.encoder(x, pos_emb, src_key_padding_mask=mask) # (T, B, F) + x = self.encoder(x, pos_emb, src_key_padding_mask=src_key_padding_mask) # (T, B, F) if self.normalize_before: x = self.after_norm(x)