Bug fixes in conformer_bn dir

This commit is contained in:
Daniel Povey 2021-09-24 11:21:25 +08:00
parent 6636c05f12
commit 2582c5fe78
2 changed files with 1 additions and 20 deletions

View File

@ -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)

View File

@ -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