From 2582c5fe785545f90aac49cbf071a7af27705883 Mon Sep 17 00:00:00 2001 From: Daniel Povey Date: Fri, 24 Sep 2021 11:21:25 +0800 Subject: [PATCH] Bug fixes in conformer_bn dir --- .../ASR/conformer_ctc_bn/conformer.py | 2 +- egs/librispeech/ASR/conformer_ctc_bn/train.py | 19 ------------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/egs/librispeech/ASR/conformer_ctc_bn/conformer.py b/egs/librispeech/ASR/conformer_ctc_bn/conformer.py index e4130183f..bb220b292 100644 --- a/egs/librispeech/ASR/conformer_ctc_bn/conformer.py +++ b/egs/librispeech/ASR/conformer_ctc_bn/conformer.py @@ -246,7 +246,7 @@ class DiscreteBottleneck(nn.Module): self.class_probs = (self.class_probs * self.class_probs_decay + mean_class_probs * (1.0 - self.class_probs_decay)) prob_floor = self.min_prob_ratio / self.classes_per_group - self.class_offsets += (self.class_probs > prob_floor) * self.prob_boost + self.class_offsets += (self.class_probs < prob_floor) * self.prob_boost else: x = torch.softmax(x, dim=-1) diff --git a/egs/librispeech/ASR/conformer_ctc_bn/train.py b/egs/librispeech/ASR/conformer_ctc_bn/train.py index 667f2c773..ee9139922 100755 --- a/egs/librispeech/ASR/conformer_ctc_bn/train.py +++ b/egs/librispeech/ASR/conformer_ctc_bn/train.py @@ -21,25 +21,6 @@ # 6000 of epoch 15. was 0.429 last time the valid loss was printed on # epoch 14. - -# RESULTS (it's worse!), with: -# python3 conformer_ctc_bn/decode.py --lattice-score-scale=0.5 --method=attention-decoder --epoch=25 --avg=10 --max-duration=30 -# -# With sampling in test-time: -# ngram_lm_scale_1.2_attention_scale_1.5 3.48 best for test-clean -# ngram_lm_scale_0.9_attention_scale_1.2 8.4 best for test-other - -# After I modified conformer.py so that in eval mode, it uses the softmax output with no sampling: -# ngram_lm_scale_0.9_attention_scale_1.2 3.44 best for test-clean -# ngram_lm_scale_0.9_attention_scale_1.0 8.09 best for test-other - -# Vs. BASELINE: -# evaluated with -# python3 conformer_ctc/decode.py --lattice-score-scale=0.5 --method=attention-decoder --epoch=23 --avg=10 --max-duration=30 & -# (also uses foam optimizer) -# ngram_lm_scale_1.2_attention_scale_1.2 2.8 best for test-clean -# ngram_lm_scale_0.9_attention_scale_0.7 6.6 best for test-other - import argparse import logging from pathlib import Path