Skip to content

Commit

Permalink
Update conformer.py (#1200)
Browse files Browse the repository at this point in the history
* Update conformer.py
* Update zipformer.py

fix bug in get_dynamic_dropout_rate
  • Loading branch information
l2009312042 authored Sep 21, 2023
1 parent bbb03f7 commit 45d60ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion egs/librispeech/ASR/streaming_conformer_ctc/conformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 45d60ef

Please sign in to comment.