this commit should finalize the PR (hopefully)

This commit is contained in:
zr_jin 2023-08-30 10:50:34 +08:00
parent 9bc287ca03
commit c65f80a11f
7 changed files with 63 additions and 8 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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