Commit 6a2f4065 by xuchen

modify the shell scripts

parent de171aee
#train-subset: train-clean-100,train-clean-360,train-other-500 train-subset: train-clean-100,train-clean-360,train-other-500
train-subset: train-clean-100 #train-subset: train-clean-100
valid-subset: dev-clean valid-subset: dev-clean
max-epoch: 100 max-epoch: 100
max-update: 300000 max-update: 300000
num-workers: 0 num-workers: 8
patience: 10 patience: 10
no-progress-bar: True no-progress-bar: True
log-interval: 100 log-interval: 100
seed: 1 seed: 1
report-accuracy: True report-accuracy: True
arch: s2t_transformer_s arch: s2t_conformer_s
share-decoder-input-output-embed: True share-decoder-input-output-embed: True
optimizer: adam optimizer: adam
clip-norm: 10.0 clip-norm: 10.0
......
train-subset: train-clean-100,train-clean-360,train-other-500
valid-subset: dev-clean
max-epoch: 100
max-update: 300000
num-workers: 8
patience: 10
no-progress-bar: True
log-interval: 100
seed: 1
report-accuracy: True
arch: s2t_conformer_s
share-decoder-input-output-embed: True
optimizer: adam
clip-norm: 10.0
lr-scheduler: inverse_sqrt
warmup-init-lr: 1e-7
warmup-updates: 10000
lr: 2e-3
#adam_betas: (0.9,0.98)
ctc-weight: 0.3
criterion: label_smoothed_cross_entropy_with_ctc
label_smoothing: 0.1
conv-kernel-sizes: 5,5
conv-channels: 1024
dropout: 0.1
activation-fn: relu
encoder-embed-dim: 256
encoder-ffn-embed-dim: 2048
encoder-layers: 12
decoder-layers: 6
encoder-attention-heads: 4
macaron-style: True
use-cnn-module: True
cnn-module-kernel: 31
#decoder-embed-dim: 256
#decoder-ffn-embed-dim: 2048
#decoder-attention-heads: 4
#attention-dropout: 0.1
#activation-dropout: 0.1
#train-subset: train-clean-100,train-clean-360,train-other-500
train-subset: train-clean-100
valid-subset: dev-clean
max-epoch: 100
max-update: 300000
num-workers: 0
patience: 10
no-progress-bar: True
log-interval: 100
seed: 1
report-accuracy: True
arch: s2t_conformer_s
share-decoder-input-output-embed: True
optimizer: adam
clip-norm: 10.0
lr-scheduler: inverse_sqrt
warmup-init-lr: 1e-7
warmup-updates: 10000
lr: 2e-3
#adam_betas: (0.9,0.98)
ctc-weight: 0.3
criterion: label_smoothed_cross_entropy_with_ctc
label_smoothing: 0.1
conv-kernel-sizes: 5,5
conv-channels: 1024
dropout: 0.1
activation-fn: relu
encoder-embed-dim: 256
encoder-ffn-embed-dim: 2048
encoder-layers: 3
decoder-layers: 3
encoder-attention-heads: 4
macaron-style: True
use-cnn-module: True
cnn-module-kernel: 31
#decoder-embed-dim: 256
#decoder-ffn-embed-dim: 2048
#decoder-attention-heads: 4
#attention-dropout: 0.1
#activation-dropout: 0.1
...@@ -13,7 +13,7 @@ get_devices(){ ...@@ -13,7 +13,7 @@ get_devices(){
do do
line=`expr $dev + 2` line=`expr $dev + 2`
use=`cat $record | head -n $line | tail -1 | cut -d '|' -f3 | cut -d '/' -f1` use=`cat $record | head -n $line | tail -1 | cut -d '|' -f3 | cut -d '/' -f1`
if [[ $use -lt 10 ]]; then if [[ $use -lt 100 ]]; then
device[$count]=$dev device[$count]=$dev
count=`expr $count + 1` count=`expr $count + 1`
if [[ $count -eq $gpu_num ]]; then if [[ $count -eq $gpu_num ]]; then
......
...@@ -24,7 +24,7 @@ device=() ...@@ -24,7 +24,7 @@ device=()
gpu_num=8 gpu_num=8
update_freq=1 update_freq=1
root_dir=~/Code/st/fairseq root_dir=~/st/Fairseq-S2T
pwd_dir=$PWD pwd_dir=$PWD
# dataset # dataset
...@@ -36,7 +36,8 @@ task=speech_to_text ...@@ -36,7 +36,8 @@ task=speech_to_text
vocab_type=unigram vocab_type=unigram
vocab_size=10000 vocab_size=10000
data_dir=~/Code/st/data/${dataset} org_data_dir=/meida/data/${dataset}
data_dir=~/st/data/${dataset}
test_subset=(dev-clean dev-other test-clean test-other) test_subset=(dev-clean dev-other test-clean test-other)
# exp # exp
...@@ -46,11 +47,11 @@ exp_tag=baseline ...@@ -46,11 +47,11 @@ exp_tag=baseline
exp_name= exp_name=
# config # config
train_config=asr_train_ctc.yaml train_config=train_ctc.yaml
data_config=config.yaml data_config=config.yaml
# training setting # training setting
fp16=0 fp16=1
max_tokens=40000 max_tokens=40000
step_valid=0 step_valid=0
...@@ -80,7 +81,7 @@ if [[ -z ${exp_name} ]]; then ...@@ -80,7 +81,7 @@ if [[ -z ${exp_name} ]]; then
fi fi
fi fi
model_dir=$root_dir/../checkpoints/$dataset/$task/asr/${exp_name} model_dir=$root_dir/../checkpoints/$dataset/asr/${exp_name}
if [ ${stage} -le -1 ] && [ ${stop_stage} -ge -1 ]; then if [ ${stage} -le -1 ] && [ ${stop_stage} -ge -1 ]; then
echo "stage -1: Data Download" echo "stage -1: Data Download"
...@@ -92,6 +93,7 @@ if [ ${stage} -le 0 ] && [ ${stop_stage} -ge 0 ]; then ...@@ -92,6 +93,7 @@ if [ ${stage} -le 0 ] && [ ${stop_stage} -ge 0 ]; then
### But you can utilize Kaldi recipes in most cases ### But you can utilize Kaldi recipes in most cases
echo "stage 0: Data Preparation" echo "stage 0: Data Preparation"
cmd="python ${root_dir}/examples/speech_to_text/prep_librispeech_data.py cmd="python ${root_dir}/examples/speech_to_text/prep_librispeech_data.py
--data-root ${org_data_dir}
--output-root ${data_dir} --output-root ${data_dir}
--vocab-type ${vocab_type} --vocab-type ${vocab_type}
--vocab-size ${vocab_size}" --vocab-size ${vocab_size}"
...@@ -101,7 +103,7 @@ fi ...@@ -101,7 +103,7 @@ fi
if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then
echo "stage 1: ASR Network Training" echo "stage 1: ASR Network Training"
[[ ! -d $data_dir ]] && echo "The data dir $data_dir is not existing!" && exit 1; [[ ! -d ${data_dir} ]] && echo "The data dir $data_dir is not existing!" && exit 1;
if [[ -z ${device} || ${#device[@]} -eq 0 ]]; then if [[ -z ${device} || ${#device[@]} -eq 0 ]]; then
if [[ ${gpu_num} -eq 0 ]]; then if [[ ${gpu_num} -eq 0 ]]; then
...@@ -112,7 +114,7 @@ if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then ...@@ -112,7 +114,7 @@ if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then
fi fi
fi fi
echo -e "dev=${device} data=$data_dir model=${model_dir}" echo -e "dev=${device} data=${data_dir} model=${model_dir}"
if [[ ! -d ${model_dir} ]]; then if [[ ! -d ${model_dir} ]]; then
mkdir -p ${model_dir} mkdir -p ${model_dir}
...@@ -125,10 +127,10 @@ if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then ...@@ -125,10 +127,10 @@ if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then
cp ${train_config} ${model_dir} cp ${train_config} ${model_dir}
cmd="python3 -u ${root_dir}/fairseq_cli/train.py cmd="python3 -u ${root_dir}/fairseq_cli/train.py
$data_dir ${data_dir}
--config-yaml ${data_config} --config-yaml ${data_config}
--train-config ${train_config} --train-config ${train_config}
--task speech_to_text --task ${task}
--max-tokens ${max_tokens} --max-tokens ${max_tokens}
--update-freq ${update_freq} --update-freq ${update_freq}
--log-interval 100 --log-interval 100
...@@ -177,7 +179,7 @@ if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then ...@@ -177,7 +179,7 @@ if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then
# save info # save info
log=./history.log log=./history.log
echo "${time} | ${device} | $data_dir | ${model_dir} " >> $log echo "${time} | ${device} | ${data_dir} | ${model_dir} " >> $log
cat $log | tail -n 50 > tmp.log cat $log | tail -n 50 > tmp.log
mv tmp.log $log mv tmp.log $log
export CUDA_VISIBLE_DEVICES=${device} export CUDA_VISIBLE_DEVICES=${device}
...@@ -225,7 +227,7 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then ...@@ -225,7 +227,7 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
for subset in ${test_subset[@]}; do for subset in ${test_subset[@]}; do
subset=${subset} subset=${subset}
cmd="python ${root_dir}/fairseq_cli/generate.py cmd="python ${root_dir}/fairseq_cli/generate.py
${data_dir}/$lang ${data_dir}
--config-yaml ${data_config} --config-yaml ${data_config}
--gen-subset ${subset} --gen-subset ${subset}
--task speech_to_text --task speech_to_text
......
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
# training the model # training the model
gpu_num=0 gpu_num=8
update_freq=1 update_freq=2
max_tokens=20000
extra_tag= extra_tag=
extra_parameter= extra_parameter=
...@@ -12,9 +13,8 @@ extra_parameter= ...@@ -12,9 +13,8 @@ extra_parameter=
#extra_parameter="${extra_parameter} " #extra_parameter="${extra_parameter} "
exp_tag=test exp_tag=test
train_config=asr_train_ctc.yaml train_config=train_ctc.yaml
max_tokens=4000
cmd="./run.sh cmd="./run.sh
--stage 1 --stage 1
......
...@@ -34,7 +34,7 @@ dropout: 0.1 ...@@ -34,7 +34,7 @@ dropout: 0.1
activation-fn: relu activation-fn: relu
encoder-embed-dim: 256 encoder-embed-dim: 256
encoder-ffn-embed-dim: 2048 encoder-ffn-embed-dim: 2048
encoder-layers: 6 encoder-layers: 12
decoder-layers: 6 decoder-layers: 6
encoder-attention-heads: 4 encoder-attention-heads: 4
......
...@@ -13,7 +13,7 @@ get_devices(){ ...@@ -13,7 +13,7 @@ get_devices(){
do do
line=`expr $dev + 2` line=`expr $dev + 2`
use=`cat $record | head -n $line | tail -1 | cut -d '|' -f3 | cut -d '/' -f1` use=`cat $record | head -n $line | tail -1 | cut -d '|' -f3 | cut -d '/' -f1`
if [[ $use -lt 10 ]]; then if [[ $use -lt 100 ]]; then
device[$count]=$dev device[$count]=$dev
count=`expr $count + 1` count=`expr $count + 1`
if [[ $count -eq $gpu_num ]]; then if [[ $count -eq $gpu_num ]]; then
......
...@@ -38,8 +38,8 @@ encoder-layers: 6 ...@@ -38,8 +38,8 @@ encoder-layers: 6
decoder-layers: 6 decoder-layers: 6
encoder-attention-heads: 4 encoder-attention-heads: 4
macaron-style: true macaron-style: True
use-cnn-module: true use-cnn-module: True
cnn-module-kernel: 31 cnn-module-kernel: 31
#decoder-embed-dim: 256 #decoder-embed-dim: 256
......
train-subset: train_st
valid-subset: dev_st
max-epoch: 100
max-update: 100000
num-workers: 8
patience: 10
no-progress-bar: True
log-interval: 100
seed: 1
report-accuracy: True
#load-params:
#load-pretrained-encoder-from:
arch: s2t_transformer_s
share-decoder-input-output-embed: True
optimizer: adam
clip-norm: 10.0
lr-scheduler: inverse_sqrt
warmup-init-lr: 1e-7
warmup-updates: 10000
lr: 2e-3
#adam_betas: (0.9,0.98)
ctc-weight: 0.3
criterion: label_smoothed_cross_entropy_with_ctc
label_smoothing: 0.1
conv-kernel-sizes: 5,5
conv-channels: 1024
dropout: 0.1
activation-fn: relu
encoder-embed-dim: 256
encoder-ffn-embed-dim: 2048
encoder-layers: 6
decoder-layers: 6
encoder-attention-heads: 4
encoder-attention-type: rel_selfattn
#decoder-embed-dim: 256
#decoder-ffn-embed-dim: 2048
#decoder-attention-heads: 4
#attention-dropout: 0.1
#activation-dropout: 0.1
...@@ -13,7 +13,7 @@ get_devices(){ ...@@ -13,7 +13,7 @@ get_devices(){
do do
line=`expr $dev + 2` line=`expr $dev + 2`
use=`cat $record | head -n $line | tail -1 | cut -d '|' -f3 | cut -d '/' -f1` use=`cat $record | head -n $line | tail -1 | cut -d '|' -f3 | cut -d '/' -f1`
if [[ $use -lt 10 ]]; then if [[ $use -lt 100 ]]; then
device[$count]=$dev device[$count]=$dev
count=`expr $count + 1` count=`expr $count + 1`
if [[ $count -eq $gpu_num ]]; then if [[ $count -eq $gpu_num ]]; then
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
# training the model # training the model
gpu_num=8 gpu_num=8
update_freq=1 update_freq=2
max_tokens=40000 max_tokens=20000
extra_tag= extra_tag=
extra_parameter= extra_parameter=
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论