From c65f80a11f3821acc79d8d7a539a34948519e9b8 Mon Sep 17 00:00:00 2001 From: zr_jin <60612200+JinZr@users.noreply.github.com> Date: Wed, 30 Aug 2023 10:50:34 +0800 Subject: [PATCH] this commit should finalize the PR (hopefully) --- egs/aidatatang_200zh/ASR/prepare.sh | 4 ++- egs/aishell/ASR/RESULTS.md | 52 +++++++++++++++++++++++++++-- egs/aishell/ASR/prepare.sh | 3 +- egs/aishell2/ASR/RESULTS.md | 2 +- egs/aishell2/ASR/prepare.sh | 4 ++- egs/aishell4/ASR/RESULTS.md | 2 +- egs/aishell4/ASR/prepare.sh | 4 ++- 7 files changed, 63 insertions(+), 8 deletions(-) diff --git a/egs/aidatatang_200zh/ASR/prepare.sh b/egs/aidatatang_200zh/ASR/prepare.sh index 2eb0b3718..40ee2eb97 100755 --- a/egs/aidatatang_200zh/ASR/prepare.sh +++ b/egs/aidatatang_200zh/ASR/prepare.sh @@ -7,6 +7,8 @@ set -eou pipefail stage=-1 stop_stage=100 +perturb_speed=true + # We assume dl_dir (download dir) contains the following # directories and files. If not, they will be downloaded @@ -77,7 +79,7 @@ if [ $stage -le 4 ] && [ $stop_stage -ge 4 ]; then log "Stage 4: Compute fbank for aidatatang_200zh" if [ ! -f data/fbank/.aidatatang_200zh.done ]; then mkdir -p data/fbank - ./local/compute_fbank_aidatatang_200zh.py --perturb-speed True + ./local/compute_fbank_aidatatang_200zh.py --perturb-speed ${perturb_speed} touch data/fbank/.aidatatang_200zh.done fi fi diff --git a/egs/aishell/ASR/RESULTS.md b/egs/aishell/ASR/RESULTS.md index bf649ec03..3e06ad372 100644 --- a/egs/aishell/ASR/RESULTS.md +++ b/egs/aishell/ASR/RESULTS.md @@ -7,6 +7,54 @@ [./zipformer](./zipformer) It's reworked Zipformer with Pruned RNNT loss, note that results below are produced by model trained on data without speed perturbation applied. +**Caution**: It uses `--context-size=1`. + +##### normal-scaled model, number of model parameters: 73412551, i.e., 73.41 M + +| | test | dev | comment | +|------------------------|------|------|-----------------------------------------| +| greedy search | 4.73 | 4.54 | --epoch 38 --avg 14 | +| modified beam search | 4.49 | 4.27 | --epoch 40 --avg 12 | +| fast beam search | 4.65 | 4.4 | --epoch 40 --avg 12 | + +Command for training is: +```bash +./prepare.sh + +export CUDA_VISIBLE_DEVICES="0,1" + +./zipformer/train.py \ + --world-size 2 \ + --num-epochs 40 \ + --start-epoch 1 \ + --use-fp16 1 \ + --context-size 1 \ + --enable-musan 0 \ + --exp-dir zipformer/exp \ + --max-duration 1000 +``` + +Command for decoding is: +```bash +./zipformer/decode.py \ + --epoch 38 \ + --avg 14 \ + --exp-dir ./zipformer/exp \ + --lang-dir data/lang_char \ + --context-size 1 \ + --decoding-method greedy_search + +for m in modified_beam_search fast_beam_search ; do + ./zipformer/decode.py \ + --epoch 40 \ + --avg 12 \ + --exp-dir ./zipformer/exp \ + --lang-dir data/lang_char \ + --context-size 1 \ + --decoding-method $m +done +``` + **⚠️ If you prefer to have the speed perturbation disabled, please manually set `--perturb-speed` to `False` for `./local/compute_fbank_aishell.py` in the `prepare.sh` script.** @@ -20,7 +68,7 @@ It's reworked Zipformer with Pruned RNNT loss, note that results below are produ Command for training is: ```bash -./prepare.sh # after setting --perturb-speed to False in the prepare.sh +./prepare.sh --perturb-speed false export CUDA_VISIBLE_DEVICES="0,1" @@ -59,7 +107,7 @@ done Command for training is: ```bash -./prepare.sh # after setting --perturb-speed to False in the prepare.sh +./prepare.sh --perturb-speed false export CUDA_VISIBLE_DEVICES="0,1" diff --git a/egs/aishell/ASR/prepare.sh b/egs/aishell/ASR/prepare.sh index ff8e1301d..efeffe480 100755 --- a/egs/aishell/ASR/prepare.sh +++ b/egs/aishell/ASR/prepare.sh @@ -8,6 +8,7 @@ set -eou pipefail nj=15 stage=-1 stop_stage=11 +perturb_speed=true # We assume dl_dir (download dir) contains the following # directories and files. If not, they will be downloaded @@ -114,7 +115,7 @@ if [ $stage -le 3 ] && [ $stop_stage -ge 3 ]; then log "Stage 3: Compute fbank for aishell" if [ ! -f data/fbank/.aishell.done ]; then mkdir -p data/fbank - ./local/compute_fbank_aishell.py --perturb-speed True + ./local/compute_fbank_aishell.py --perturb-speed ${perturb_speed} touch data/fbank/.aishell.done fi fi diff --git a/egs/aishell2/ASR/RESULTS.md b/egs/aishell2/ASR/RESULTS.md index a5f960dba..7e635aa36 100644 --- a/egs/aishell2/ASR/RESULTS.md +++ b/egs/aishell2/ASR/RESULTS.md @@ -21,7 +21,7 @@ It's reworked Zipformer with Pruned RNNT loss, note that results below are produ The training command for reproducing is given below: ```bash -./prepare.sh # after setting --perturb-speed to False in the prepare.sh +./prepare.sh --perturb-speed false export CUDA_VISIBLE_DEVICES="0,1" diff --git a/egs/aishell2/ASR/prepare.sh b/egs/aishell2/ASR/prepare.sh index ab9acc7fa..6eb6268f5 100755 --- a/egs/aishell2/ASR/prepare.sh +++ b/egs/aishell2/ASR/prepare.sh @@ -8,6 +8,8 @@ set -eou pipefail nj=30 stage=0 stop_stage=7 +perturb_speed=true + # We assume dl_dir (download dir) contains the following # directories and files. If not, you need to apply aishell2 through @@ -101,7 +103,7 @@ if [ $stage -le 3 ] && [ $stop_stage -ge 3 ]; then log "Stage 3: Compute fbank for aishell2" if [ ! -f data/fbank/.aishell2.done ]; then mkdir -p data/fbank - ./local/compute_fbank_aishell2.py --perturb-speed True + ./local/compute_fbank_aishell2.py --perturb-speed ${perturb_speed} touch data/fbank/.aishell2.done fi fi diff --git a/egs/aishell4/ASR/RESULTS.md b/egs/aishell4/ASR/RESULTS.md index 7d99b2f05..92f461de9 100644 --- a/egs/aishell4/ASR/RESULTS.md +++ b/egs/aishell4/ASR/RESULTS.md @@ -20,7 +20,7 @@ It's reworked Zipformer with Pruned RNNT loss, note that results below are produ Command for training is: ```bash -./prepare.sh # after setting --perturb-speed to False in the prepare.sh +./prepare.sh --perturb-speed false export CUDA_VISIBLE_DEVICES="0,1" diff --git a/egs/aishell4/ASR/prepare.sh b/egs/aishell4/ASR/prepare.sh index 1b1ec0005..361cc26ab 100755 --- a/egs/aishell4/ASR/prepare.sh +++ b/egs/aishell4/ASR/prepare.sh @@ -7,6 +7,8 @@ set -eou pipefail stage=-1 stop_stage=100 +perturb_speed=true + # We assume dl_dir (download dir) contains the following # directories and files. If not, they will be downloaded @@ -107,7 +109,7 @@ if [ $stage -le 5 ] && [ $stop_stage -ge 5 ]; then log "Stage 5: Compute fbank for aishell4" if [ ! -f data/fbank/.aishell4.done ]; then mkdir -p data/fbank - ./local/compute_fbank_aishell4.py --perturb-speed True + ./local/compute_fbank_aishell4.py --perturb-speed ${perturb_speed} touch data/fbank/.aishell4.done fi fi