Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
F
Fairseq-S2T
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
xuchen
Fairseq-S2T
Commits
99763132
Commit
99763132
authored
Oct 23, 2021
by
xuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize the shell scripts
parent
5160a9f5
隐藏空白字符变更
内嵌
并排
正在显示
34 个修改的文件
包含
356 行增加
和
300 行删除
+356
-300
egs/librispeech/asr/conf/base.yaml
+1
-1
egs/librispeech/asr/conf/conformer.yaml
+1
-1
egs/librispeech/asr/conf/ctc.yaml
+0
-44
egs/librispeech/asr/conf/debug.yaml
+7
-11
egs/librispeech/asr/conf/large.yaml
+11
-15
egs/librispeech/asr/conf/pyramid3_base.yaml
+7
-11
egs/librispeech/asr/conf/pyramid4_base.yaml
+18
-18
egs/librispeech/asr/conf/pyramid4_base_sr8.yaml
+56
-0
egs/librispeech/asr/conf/pyramid4_deep18.yaml
+56
-0
egs/librispeech/asr/conf/pyramid4_deep30.yaml
+14
-14
egs/librispeech/asr/conf/pyramid4_large.yaml
+9
-14
egs/librispeech/asr/conf/rpr.yaml
+3
-3
egs/librispeech/asr/decode.sh
+1
-1
egs/librispeech/asr/run.sh
+9
-7
egs/librispeech/asr/train.sh
+9
-7
egs/mustc/asr/conf/base.yaml
+2
-2
egs/mustc/asr/conf/ctc.yaml
+0
-44
egs/mustc/asr/conf/pyramid4_base.yaml
+11
-9
egs/mustc/asr/conf/pyramid4_base_sr8.yaml
+16
-13
egs/mustc/asr/conf/rpr.yaml
+3
-3
egs/mustc/asr/conf/tmp.yaml
+0
-2
egs/mustc/asr/local/monitor.sh
+1
-1
egs/mustc/asr/run.sh
+2
-2
egs/mustc/asr/train.sh
+8
-2
egs/mustc/mt/decode.sh
+4
-4
egs/mustc/mt/run.sh
+13
-12
egs/mustc/mt/train.sh
+2
-2
egs/mustc/st/conf/base.yaml
+2
-2
egs/mustc/st/conf/ctc.yaml
+2
-45
egs/mustc/st/conf/pyramid4_base_sr8.yaml
+58
-0
egs/mustc/st/conf/sate_ctc.yaml
+20
-6
egs/mustc/st/conf/tmp.yaml
+0
-2
egs/mustc/st/decode.sh
+1
-1
egs/mustc/st/train.sh
+9
-1
没有找到文件。
egs/librispeech/asr/conf/base.yaml
查看文件 @
99763132
...
...
@@ -24,7 +24,7 @@ warmup-updates: 10000
lr
:
2e-3
#adam_betas: (0.9,0.98)
criterion
:
label_smoothed_cross_entropy
criterion
:
label_smoothed_cross_entropy
_with_ctc
label_smoothing
:
0.1
conv-kernel-sizes
:
5,5
...
...
egs/librispeech/asr/conf/conformer.yaml
查看文件 @
99763132
...
...
@@ -2,4 +2,4 @@ arch: s2t_conformer_s
macaron-style
:
True
use-cnn-module
:
True
cnn-module-kernel
:
15
cnn-module-kernel
:
31
egs/librispeech/asr/conf/ctc.yaml
查看文件 @
99763132
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
#load-pretrained-encoder-from:
#load-pretrained-decoder-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
:
12
decoder-layers
:
6
encoder-attention-heads
:
4
decoder-embed-dim
:
256
decoder-ffn-embed-dim
:
2048
decoder-attention-heads
:
4
attention-dropout
:
0.1
activation-dropout
:
0.1
egs/librispeech/asr/conf/
ctc_
debug.yaml
→
egs/librispeech/asr/conf/debug.yaml
查看文件 @
99763132
#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
num-workers
:
8
patience
:
10
no-progress-bar
:
True
log-interval
:
100
seed
:
1
report-accuracy
:
True
#load-pretrained-encoder-from:
#load-pretrained-decoder-from:
arch
:
s2t_transformer_s
share-decoder-input-output-embed
:
True
optimizer
:
adam
...
...
@@ -22,26 +24,20 @@ warmup-updates: 10000
lr
:
2e-3
#adam_betas: (0.9,0.98)
ctc-weight
:
0.3
criterion
:
label_smoothed_cross_entropy_with_ctc
ctc-weight
:
0.3
label_smoothing
:
0.1
conv-kernel-sizes
:
5,5
conv-channels
:
1024
dropout
:
0.1
activation-fn
:
relu
#
encoder-embed-dim: 256
encoder-embed-dim
:
256
encoder-ffn-embed-dim
:
2048
encoder-layers
:
12
decoder-layers
:
3
decoder-layers
:
6
encoder-attention-heads
:
4
macaron-style
:
True
use-cnn-module
:
True
cnn-module-kernel
:
31
adpater
:
subsample
decoder-embed-dim
:
256
decoder-ffn-embed-dim
:
2048
decoder-attention-heads
:
4
...
...
egs/
mustc/st/conf/pyramid
.yaml
→
egs/
librispeech/asr/conf/large
.yaml
查看文件 @
99763132
arch
:
pys2t_transformer_s
#conv-kernel-sizes: 5
encoder-embed-dim
:
512
pyramid-layers
:
3_6_9
ctc-layer
:
7
train-subset
:
train_st
valid-subset
:
dev_st
train-subset
:
train-clean-100,train-clean-360,train-other-500
valid-subset
:
dev-clean
max-epoch
:
5
0
max-update
:
1
00000
max-epoch
:
10
0
max-update
:
3
00000
num-workers
:
8
patience
:
1
0
patience
:
2
0
no-progress-bar
:
True
log-interval
:
100
seed
:
1
...
...
@@ -20,6 +14,7 @@ report-accuracy: True
#load-pretrained-encoder-from:
#load-pretrained-decoder-from:
arch
:
s2t_transformer_m
share-decoder-input-output-embed
:
True
optimizer
:
adam
clip-norm
:
10.0
...
...
@@ -29,20 +24,21 @@ 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
:
512
encoder-ffn-embed-dim
:
2048
encoder-layers
:
12
decoder-layers
:
6
encoder-attention-heads
:
4
encoder-attention-heads
:
8
decoder-embed-dim
:
256
decoder-embed-dim
:
512
decoder-ffn-embed-dim
:
2048
decoder-attention-heads
:
4
decoder-attention-heads
:
8
attention-dropout
:
0.1
activation-dropout
:
0.1
egs/librispeech/asr/conf/pyramid
_stage3
.yaml
→
egs/librispeech/asr/conf/pyramid
3_base
.yaml
查看文件 @
99763132
arch
:
pys2t_transformer_s
encoder-embed-dim
:
512
encoder-embed-dim
:
256
pyramid-stages
:
3
pyramid-layers
:
3_6_3
#encoder-attention-type: reduced
#pyramid-attn-sample-ratios: 4_2_1
#pyramid-block-attn: True
#pyramid-fuse-way: gated
pyramid-use-ppm
:
True
pyramid-fuse-way
:
all_conv
pyramid-fuse
:
True
pyramid-sr-ratios
:
2_2_2
pyramid-embed-dims
:
128_256_512
pyramid-embed-dims
:
256_256_256
pyramid-reduced-embed
:
conv
pyramid-embed-norm
:
True
pyramid-position-embed
:
1_1_1
pyramid-kernel-sizes
:
5_5_5
pyramid-ffn-ratios
:
8_8_
4
pyramid-heads
:
2_4_8
pyramid-ffn-ratios
:
8_8_
8
pyramid-heads
:
4_4_4
train-subset
:
train-clean-100,train-clean-360,train-other-500
valid-subset
:
dev-clean
...
...
@@ -23,7 +20,7 @@ max-epoch: 100
max-update
:
300000
num-workers
:
8
patience
:
1
0
patience
:
2
0
no-progress-bar
:
True
log-interval
:
100
seed
:
1
...
...
@@ -42,7 +39,6 @@ lr: 2e-3
#adam_betas: (0.9,0.98)
criterion
:
label_smoothed_cross_entropy_with_ctc
ctc-weight
:
0
label_smoothing
:
0.1
conv-channels
:
1024
...
...
egs/
mustc/asr/conf/pyramid_stage3
.yaml
→
egs/
librispeech/asr/conf/pyramid4_base
.yaml
查看文件 @
99763132
arch
:
pys2t_transformer_s
encoder-embed-dim
:
512
pyramid-stages
:
3
pyramid-layers
:
3_6_3
pyramid-
sr-ratios
:
2_2
_2
#pyramid-block-attn: True
#pyramid-fuse-way: add
pyramid-
use-ppm
:
True
pyramid-embed-dims
:
128_256_512
encoder-embed-dim
:
256
pyramid-stages
:
4
#pyramid-dropout: 0
pyramid-
layers
:
2_2_6
_2
pyramid-sr-ratios
:
2_2_2_2
pyramid-fuse
:
True
pyramid-
fuse-way
:
all_conv
pyramid-embed-dims
:
256_256_256_256
pyramid-reduced-embed
:
conv
pyramid-embed-norm
:
True
pyramid-position-embed
:
1_1_1
pyramid-kernel-sizes
:
5_5_5
pyramid-ffn-ratios
:
8_8_
4
pyramid-heads
:
2_4_8
pyramid-position-embed
:
1_1_1
_1
pyramid-kernel-sizes
:
5_5_5
_5
pyramid-ffn-ratios
:
8_8_
8_8
pyramid-heads
:
4_4_4_4
train-subset
:
train
_asr
valid-subset
:
dev
_asr
train-subset
:
train
-clean-100,train-clean-360,train-other-500
valid-subset
:
dev
-clean
max-epoch
:
5
0
max-update
:
1
00000
max-epoch
:
10
0
max-update
:
3
00000
num-workers
:
8
patience
:
1
0
patience
:
2
0
no-progress-bar
:
True
log-interval
:
100
seed
:
1
...
...
@@ -39,7 +39,7 @@ warmup-updates: 10000
lr
:
2e-3
#adam_betas: (0.9,0.98)
criterion
:
label_smoothed_cross_entropy
criterion
:
label_smoothed_cross_entropy
_with_ctc
label_smoothing
:
0.1
conv-channels
:
1024
...
...
egs/librispeech/asr/conf/pyramid4_base_sr8.yaml
0 → 100644
查看文件 @
99763132
arch
:
pys2t_transformer_s
encoder-embed-dim
:
256
pyramid-stages
:
4
pyramid-layers
:
3_3_3_3
pyramid-sr-ratios
:
2_2_1_2
pyramid-fuse
:
True
pyramid-fuse-way
:
all_conv
pyramid-embed-dims
:
256_256_256_256
pyramid-reduced-embed
:
conv
pyramid-embed-norm
:
True
pyramid-position-embed
:
1_1_1_1
pyramid-kernel-sizes
:
5_5_5_5
pyramid-ffn-ratios
:
8_8_8_8
pyramid-heads
:
4_4_4_4
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
:
20
no-progress-bar
:
True
log-interval
:
100
seed
:
1
report-accuracy
:
True
#load-pretrained-encoder-from:
#load-pretrained-decoder-from:
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)
criterion
:
label_smoothed_cross_entropy_with_ctc
label_smoothing
:
0.1
conv-channels
:
1024
dropout
:
0.1
activation-fn
:
relu
encoder-ffn-embed-dim
:
2048
encoder-layers
:
12
decoder-layers
:
6
encoder-attention-heads
:
4
decoder-embed-dim
:
256
decoder-ffn-embed-dim
:
2048
decoder-attention-heads
:
4
attention-dropout
:
0.1
activation-dropout
:
0.1
egs/librispeech/asr/conf/pyramid4_deep18.yaml
0 → 100644
查看文件 @
99763132
arch
:
pys2t_transformer_s
encoder-embed-dim
:
256
pyramid-stages
:
4
pyramid-layers
:
3_3_8_4
pyramid-sr-ratios
:
2_2_2_2
pyramid-fuse
:
True
pyramid-fuse-way
:
all_conv
pyramid-embed-dims
:
256_256_256_256
pyramid-reduced-embed
:
conv
pyramid-embed-norm
:
True
pyramid-position-embed
:
1_1_1_1
pyramid-kernel-sizes
:
5_5_5_5
pyramid-ffn-ratios
:
8_8_8_8
pyramid-heads
:
4_4_4_4
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
:
20
no-progress-bar
:
True
log-interval
:
100
seed
:
1
report-accuracy
:
True
#load-pretrained-encoder-from:
#load-pretrained-decoder-from:
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)
criterion
:
label_smoothed_cross_entropy_with_ctc
label_smoothing
:
0.1
conv-channels
:
1024
dropout
:
0.1
activation-fn
:
relu
encoder-ffn-embed-dim
:
2048
encoder-layers
:
12
decoder-layers
:
6
encoder-attention-heads
:
4
decoder-embed-dim
:
256
decoder-ffn-embed-dim
:
2048
decoder-attention-heads
:
4
attention-dropout
:
0.1
activation-dropout
:
0.1
egs/librispeech/asr/conf/pyramid
_enc6
.yaml
→
egs/librispeech/asr/conf/pyramid
4_deep30
.yaml
查看文件 @
99763132
arch
:
pys2t_transformer_s
encoder-embed-dim
:
512
pyramid-stages
:
3
pyramid-layers
:
3_6_3
encoder-attention-type
:
reduced
pyramid-
attn-sample-ratios
:
4_2_1
pyramid-
sr-ratios
:
2_2_2
pyramid-embed-dims
:
128_256_512
encoder-embed-dim
:
256
pyramid-stages
:
4
pyramid-layers
:
5_5_15_5
pyramid-sr-ratios
:
2_2_2_2
pyramid-
fuse
:
True
pyramid-
fuse-way
:
all_conv
pyramid-embed-dims
:
256_256_256_256
pyramid-reduced-embed
:
conv
pyramid-embed-norm
:
True
pyramid-position-embed
:
1_1_1
pyramid-kernel-sizes
:
5_5_5
pyramid-ffn-ratios
:
8_8_
4
pyramid-heads
:
2_4_8
pyramid-position-embed
:
1_1_1
_1
pyramid-kernel-sizes
:
5_5_5
_5
pyramid-ffn-ratios
:
8_8_
8_8
pyramid-heads
:
4_4_4_4
train-subset
:
train-clean-100,train-clean-360,train-other-500
valid-subset
:
dev-clean
...
...
@@ -20,7 +20,7 @@ max-epoch: 100
max-update
:
300000
num-workers
:
8
patience
:
1
0
patience
:
2
0
no-progress-bar
:
True
log-interval
:
100
seed
:
1
...
...
@@ -38,14 +38,14 @@ warmup-updates: 10000
lr
:
2e-3
#adam_betas: (0.9,0.98)
criterion
:
label_smoothed_cross_entropy
criterion
:
label_smoothed_cross_entropy
_with_ctc
label_smoothing
:
0.1
conv-channels
:
1024
dropout
:
0.1
activation-fn
:
relu
encoder-ffn-embed-dim
:
2048
encoder-layers
:
6
encoder-layers
:
12
decoder-layers
:
6
encoder-attention-heads
:
4
...
...
egs/librispeech/asr/conf/pyramid.yaml
→
egs/librispeech/asr/conf/pyramid
4_large
.yaml
查看文件 @
99763132
...
...
@@ -2,30 +2,26 @@ arch: pys2t_transformer_s
encoder-embed-dim
:
512
pyramid-stages
:
4
pyramid-layers
:
2_2_6_2
#encoder-attention-type: reduced
#pyramid-attn-sample-ratios: 8_4_2_1
#pyramid-block-attn: True
#pyramid-fuse-way: add
#pyramid-layers: 3_3_3_3
pyramid-sr-ratios
:
2_2_2_2
pyramid-use-ppm
:
True
pyramid-embed-dims
:
128_128_256_512
pyramid-reduced-embed
:
fuse
pyramid-fuse
:
True
pyramid-fuse-way
:
all_conv
pyramid-embed-dims
:
512_512_512_512
pyramid-reduced-embed
:
conv
pyramid-embed-norm
:
True
pyramid-position-embed
:
1_1_1_1
pyramid-kernel-sizes
:
5_5_5_5
pyramid-ffn-ratios
:
8_8_8_4
pyramid-heads
:
2_2_4_8
#ctc-layer: 8
pyramid-ffn-ratios
:
8_8_8_8
pyramid-heads
:
8_8_8_8
#train-subset: train-clean-100,train-clean-360,train-other-500
train-subset
:
train-clean-100
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
:
1
0
patience
:
2
0
no-progress-bar
:
True
log-interval
:
100
seed
:
1
...
...
@@ -44,7 +40,6 @@ lr: 2e-3
#adam_betas: (0.9,0.98)
criterion
:
label_smoothed_cross_entropy_with_ctc
ctc-weight
:
0.0
label_smoothing
:
0.1
conv-channels
:
1024
...
...
egs/librispeech/asr/conf/rpr.yaml
查看文件 @
99763132
#
encoder-attention-type: rel_selfattn
encoder-attention-type
:
relative
max-encoder-relative-length
:
100
encoder-attention-type
:
rel_selfattn
#
encoder-attention-type: relative
#
max-encoder-relative-length: 100
egs/librispeech/asr/decode.sh
查看文件 @
99763132
...
...
@@ -3,7 +3,7 @@
gpu_num
=
1
data_dir
=
test_subset
=(
test-clean test-other
)
test_subset
=(
dev-clean dev-other
test-clean test-other
)
exp_name
=
if
[
"$#"
-eq
1
]
;
then
...
...
egs/librispeech/asr/run.sh
查看文件 @
99763132
...
...
@@ -20,7 +20,7 @@ stop_stage=0
######## hardware ########
# devices
#
device=()
device
=()
gpu_num
=
8
update_freq
=
1
...
...
@@ -251,12 +251,14 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
# Average models
dec_model
=
avg_
${
n_average
}
_checkpoint.pt
cmd
=
"python
${
root_dir
}
/scripts/average_checkpoints.py
--inputs
${
model_dir
}
--num-epoch-checkpoints
${
n_average
}
--output
${
model_dir
}
/
${
dec_model
}
"
echo
-e
"
\0
33[34mRun command:
\n
${
cmd
}
\0
33[0m"
[[
$eval
-eq
1
]]
&&
eval
$cmd
if
[[
!
-f
${
model_dir
}
/
${
dec_model
}
]]
;
then
cmd
=
"python
${
root_dir
}
/scripts/average_checkpoints.py
--inputs
${
model_dir
}
--num-epoch-checkpoints
${
n_average
}
--output
${
model_dir
}
/
${
dec_model
}
"
echo
-e
"
\0
33[34mRun command:
\n
${
cmd
}
\0
33[0m"
[[
$eval
-eq
1
]]
&&
eval
$cmd
fi
else
dec_model
=
${
dec_model
}
fi
...
...
egs/librispeech/asr/train.sh
查看文件 @
99763132
...
...
@@ -6,11 +6,14 @@ gpu_num=8
update_freq
=
1
max_tokens
=
100000
exp_tag
=
config_list
=(
base
)
config_list
=(
base conformer
)
#config_list=(pyramid)
#config_list=(pyramid_stage3)
#exp_tag=
#config_list=(base)
#config_list=(ctc)
#config_list=(ctc conformer rpr)
config_list
=(
base conformer rpr
)
#config_list=(pyramid4_all256)
#config_list=(pyramid5_all256)
# exp full name
exp_name
=
...
...
@@ -41,8 +44,7 @@ if [[ -n ${extra_tag} ]]; then
cmd
=
"
$cmd
--extra_tag
${
extra_tag
}
"
fi
if
[[
-n
${
extra_parameter
}
]]
;
then
# cmd="$cmd --extra_parameter \"${extra_parameter}\""
cmd
=
"
$cmd
--extra_parameter
${
extra_parameter
}
"
cmd
=
"
$cmd
--extra_parameter
\"
${
extra_parameter
}
\"
"
fi
echo
${
cmd
}
...
...
egs/mustc/asr/conf/base.yaml
查看文件 @
99763132
train-subset
:
train_asr
valid-subset
:
dev_asr
max-epoch
:
5
0
max-epoch
:
10
0
max-update
:
100000
num-workers
:
8
...
...
@@ -24,7 +24,7 @@ warmup-updates: 10000
lr
:
2e-3
#adam_betas: (0.9,0.98)
criterion
:
label_smoothed_cross_entropy
criterion
:
label_smoothed_cross_entropy
_with_ctc
label_smoothing
:
0.1
conv-kernel-sizes
:
5,5
...
...
egs/mustc/asr/conf/ctc.yaml
查看文件 @
99763132
train-subset
:
train_asr
valid-subset
:
dev_asr
max-epoch
:
50
max-update
:
100000
num-workers
:
8
patience
:
10
no-progress-bar
:
True
log-interval
:
100
seed
:
1
report-accuracy
:
True
#load-pretrained-encoder-from:
#load-pretrained-decoder-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
:
12
decoder-layers
:
6
encoder-attention-heads
:
4
decoder-embed-dim
:
256
decoder-ffn-embed-dim
:
2048
decoder-attention-heads
:
4
attention-dropout
:
0.1
activation-dropout
:
0.1
egs/mustc/asr/conf/pyramid.yaml
→
egs/mustc/asr/conf/pyramid
4_base
.yaml
查看文件 @
99763132
arch
:
pys2t_transformer_s
encoder-embed-dim
:
512
encoder-embed-dim
:
256
pyramid-stages
:
4
pyramid-layers
:
2_3_5_2
#pyramid-dropout: 0
pyramid-layers
:
2_2_6_2
pyramid-sr-ratios
:
2_2_2_2
pyramid-embed-dims
:
128_128_256_512
pyramid-use-ppm
:
True
pyramid-fuse
:
True
pyramid-fuse-way
:
all_conv
pyramid-embed-dims
:
256_256_256_256
pyramid-reduced-embed
:
conv
pyramid-embed-norm
:
True
pyramid-position-embed
:
1_1_1_1
pyramid-kernel-sizes
:
5_5_5_5
pyramid-ffn-ratios
:
8_8_8_
4
pyramid-heads
:
2_2_4_8
pyramid-ffn-ratios
:
8_8_8_
8
pyramid-heads
:
4_4_4_4
train-subset
:
train_asr
valid-subset
:
dev_asr
max-epoch
:
5
0
max-epoch
:
10
0
max-update
:
100000
num-workers
:
8
patience
:
1
0
patience
:
2
0
no-progress-bar
:
True
log-interval
:
100
seed
:
1
...
...
@@ -37,7 +39,7 @@ warmup-updates: 10000
lr
:
2e-3
#adam_betas: (0.9,0.98)
criterion
:
label_smoothed_cross_entropy
criterion
:
label_smoothed_cross_entropy
_with_ctc
label_smoothing
:
0.1
conv-channels
:
1024
...
...
egs/mustc/asr/conf/pyramid
_enc6
.yaml
→
egs/mustc/asr/conf/pyramid
4_base_sr8
.yaml
查看文件 @
99763132
arch
:
pys2t_transformer_s
encoder-embed-dim
:
512
pyramid-stages
:
3
pyramid-layers
:
2_2_2
pyramid-sr-ratios
:
2_2_2
pyramid-embed-dims
:
128_256_512
encoder-embed-dim
:
256
pyramid-stages
:
4
#pyramid-dropout: 0
pyramid-layers
:
3_3_3_3
pyramid-sr-ratios
:
2_2_1_2
pyramid-fuse
:
True
pyramid-fuse-way
:
all_conv
pyramid-embed-dims
:
256_256_256_256
pyramid-reduced-embed
:
conv
pyramid-embed-norm
:
True
pyramid-position-embed
:
1_
0_0
pyramid-kernel-sizes
:
5_5_5
pyramid-ffn-ratios
:
8_8_
4
pyramid-heads
:
2_4_8
pyramid-position-embed
:
1_
1_1_1
pyramid-kernel-sizes
:
5_5_5
_5
pyramid-ffn-ratios
:
8_8_
8_8
pyramid-heads
:
4_4_4_4
train-subset
:
train_asr
valid-subset
:
dev_asr
max-epoch
:
5
0
max-epoch
:
10
0
max-update
:
100000
num-workers
:
8
patience
:
1
0
patience
:
2
0
no-progress-bar
:
True
log-interval
:
100
seed
:
1
...
...
@@ -36,14 +39,14 @@ warmup-updates: 10000
lr
:
2e-3
#adam_betas: (0.9,0.98)
criterion
:
label_smoothed_cross_entropy
criterion
:
label_smoothed_cross_entropy
_with_ctc
label_smoothing
:
0.1
conv-channels
:
1024
dropout
:
0.1
activation-fn
:
relu
encoder-ffn-embed-dim
:
2048
encoder-layers
:
6
encoder-layers
:
12
decoder-layers
:
6
encoder-attention-heads
:
4
...
...
egs/mustc/asr/conf/rpr.yaml
查看文件 @
99763132
#
encoder-attention-type: rel_selfattn
encoder-attention-type
:
relative
max-encoder-relative-length
:
100
encoder-attention-type
:
rel_selfattn
#
encoder-attention-type: relative
#
max-encoder-relative-length: 100
egs/mustc/asr/conf/tmp.yaml
deleted
100644 → 0
查看文件 @
5160a9f5
egs/mustc/asr/local/monitor.sh
查看文件 @
99763132
gpu_num
=
1
gpu_num
=
4
cmd
=
"sh train.sh"
while
:
...
...
egs/mustc/asr/run.sh
查看文件 @
99763132
...
...
@@ -41,8 +41,8 @@ lcrm=0
tokenizer
=
0
use_specific_dict
=
0
specific_prefix
=
valid
specific_dir
=
/home/xuchen/st/data/mustc/st
_lcrm
/en-de
specific_prefix
=
st
specific_dir
=
/home/xuchen/st/data/mustc/st/en-de
asr_vocab_prefix
=
spm_unigram10000_st_share
org_data_dir
=
~/st/data/
${
dataset
}
...
...
egs/mustc/asr/train.sh
查看文件 @
99763132
...
...
@@ -6,8 +6,14 @@ gpu_num=8
update_freq
=
1
max_tokens
=
40000
exp_tag
=
baseline
config_list
=(
base
)
exp_tag
=
#config_list=(base)
#config_list=(ctc)
#config_list=(base conformer)
#config_list=(pyramid4_base)
config_list
=(
pyramid4_base conformer rpr
)
# exp full name
exp_name
=
...
...
egs/mustc/mt/decode.sh
查看文件 @
99763132
...
...
@@ -13,7 +13,7 @@ fi
n_average
=
10
beam_size
=
5
len_penalty
=
1.0
max_tokens
=
1
0000
max_tokens
=
8
0000
dec_model
=
checkpoint_best.pt
cmd
=
"./run.sh
...
...
@@ -31,9 +31,9 @@ cmd="./run.sh
if
[[
-n
${
data_dir
}
]]
;
then
cmd
=
"
$cmd
--data_dir
${
data_dir
}
"
fi
if
[[
${#
test_subset
[@]
}
-ne
0
]]
;
then
subsets
=
$(
echo
${
test_subset
[*]
}
| sed
's/ /,/g'
)
cmd
=
"
$cmd
--test_subset
${
subsets
}
"
if
[[
-n
${
test_subset
}
]]
;
then
test_subset
=
`
echo
${
test_subset
[*]
}
| sed
's/ /,/g'
`
cmd
=
"
$cmd
--test_subset
${
test_subset
}
"
fi
echo
$cmd
...
...
egs/mustc/mt/run.sh
查看文件 @
99763132
...
...
@@ -20,7 +20,7 @@ stop_stage=0
######## hardware ########
# devices
#
device=()
device
=()
gpu_num
=
8
update_freq
=
1
...
...
@@ -41,10 +41,10 @@ lcrm=0
tokenizer
=
0
use_specific_dict
=
0
specific_prefix
=
wmt_share32k
specific_dir
=
/home/xuchen/st/data/
wmt/mt_lcrm/en-de/unigram32000_share
src_vocab_prefix
=
spm_unigram
32000
_share
tgt_vocab_prefix
=
spm_unigram
32000
_share
specific_prefix
=
st
specific_dir
=
/home/xuchen/st/data/
mustc/st/en-de/
src_vocab_prefix
=
spm_unigram
10000_st
_share
tgt_vocab_prefix
=
spm_unigram
10000_st
_share
org_data_dir
=
~/st/data/
${
dataset
}
data_dir
=
~/st/data/
${
dataset
}
/mt/
${
lang
}
...
...
@@ -54,14 +54,14 @@ trans_subset=tst-COMMON
test_subset
=
test
# exp
exp_prefix
=
$
(
date
"+%m%d"
)
exp_prefix
=
$
{
time
}
extra_tag
=
extra_parameter
=
exp_tag
=
baseline
exp_name
=
# config
train_config
=
base
train_config
=
base
_s
# training setting
fp16
=
1
...
...
@@ -103,6 +103,7 @@ fi
.
./local/parse_options.sh
||
exit
1
;
# full path
if
[[
-z
${
exp_name
}
]]
;
then
config_string
=
${
train_config
//,/_
}
# exp_name=${exp_prefix}_$(basename ${train_config%.*})_${exp_tag}
...
...
@@ -150,7 +151,7 @@ if [ ${stage} -le 0 ] && [ ${stop_stage} -ge 0 ]; then
mkdir
-p
${
data_dir
}
/data
for
split
in
${
train_subset
}
${
valid_subset
}
${
trans_subset
}
;
do
{
cmd
=
"cat
${
org_data_dir
}
/
${
lang
}
/data/
${
split
}
.
${
src_lang
}
"
cmd
=
"cat
${
org_data_dir
}
/
${
lang
}
/data/
${
split
}
/txt/
${
split
}
.
${
src_lang
}
"
if
[[
${
lcrm
}
-eq
1
]]
;
then
cmd
=
"python local/lower_rm.py
${
org_data_dir
}
/
${
lang
}
/data/
${
split
}
.
${
src_lang
}
"
fi
...
...
@@ -165,7 +166,7 @@ if [ ${stage} -le 0 ] && [ ${stop_stage} -ge 0 ]; then
cmd
=
"spm_encode
--model
${
data_dir
}
/
${
tgt_vocab_prefix
}
.model
--output_format=piece
<
${
org_data_dir
}
/
${
lang
}
/data/
${
split
}
.
${
tgt_lang
}
<
${
org_data_dir
}
/
${
lang
}
/data/
${
split
}
/txt/
${
split
}
.
${
tgt_lang
}
>
${
data_dir
}
/data/
${
split
}
.
${
tgt_lang
}
"
echo
-e
"
\0
33[34mRun command:
\n
${
cmd
}
\0
33[0m"
...
...
@@ -178,7 +179,7 @@ if [ ${stage} -le 0 ] && [ ${stop_stage} -ge 0 ]; then
--source-lang
${
src_lang
}
--target-lang
${
tgt_lang
}
--trainpref
${
data_dir
}
/data/
${
train_subset
}
--validpref
${
data_dir
}
/data/
${
valid_subset
}
--testpref
${
data_dir
}
/data/
${
t
est
_subset
}
--testpref
${
data_dir
}
/data/
${
t
rans
_subset
}
--destdir
${
data_dir
}
/data-bin
--srcdict
${
data_dir
}
/
${
src_vocab_prefix
}
.txt
--tgtdict
${
data_dir
}
/
${
tgt_vocab_prefix
}
.txt
...
...
@@ -265,7 +266,7 @@ if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then
save_interval
=
1
keep_last_epochs
=
10
no_epoch_checkpoints
=
0
save_interval_updates
=
100
00
save_interval_updates
=
5
00
keep_interval_updates
=
10
else
validate_interval
=
1
...
...
@@ -352,7 +353,7 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
result_file
=
${
model_dir
}
/decode_result
[[
-f
${
result_file
}
]]
&&
rm
${
result_file
}
test_subset
=
${
test_subset
//,/
}
test_subset
=
(
${
test_subset
//,/
}
)
for
subset
in
${
test_subset
[@]
}
;
do
cmd
=
"python
${
root_dir
}
/fairseq_cli/generate.py
${
data_dir
}
...
...
egs/mustc/mt/train.sh
查看文件 @
99763132
...
...
@@ -2,9 +2,9 @@
# training the model
gpu_num
=
8
gpu_num
=
1
update_freq
=
1
max_tokens
=
4096
max_tokens
=
8192
exp_tag
=
baseline
config_list
=(
base
)
...
...
egs/mustc/st/conf/base.yaml
查看文件 @
99763132
train-subset
:
train_st
valid-subset
:
dev_st
max-epoch
:
5
0
max-epoch
:
10
0
max-update
:
100000
num-workers
:
8
...
...
@@ -24,7 +24,7 @@ warmup-updates: 10000
lr
:
2e-3
#adam_betas: (0.9,0.98)
criterion
:
label_smoothed_cross_entropy
criterion
:
label_smoothed_cross_entropy
_with_ctc
label_smoothing
:
0.1
conv-kernel-sizes
:
5,5
...
...
egs/mustc/st/conf/ctc.yaml
查看文件 @
99763132
train-subset
:
train_st
valid-subset
:
dev_st
max-epoch
:
50
max-update
:
100000
num-workers
:
8
patience
:
10
no-progress-bar
:
True
log-interval
:
100
seed
:
1
report-accuracy
:
True
#load-pretrained-encoder-from:
#load-pretrained-decoder-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
:
12
decoder-layers
:
6
encoder-attention-heads
:
4
decoder-embed-dim
:
256
decoder-ffn-embed-dim
:
2048
decoder-attention-heads
:
4
attention-dropout
:
0.1
activation-dropout
:
0.1
ctc-weight
:
0.3
\ No newline at end of file
egs/mustc/st/conf/pyramid4_base_sr8.yaml
0 → 100644
查看文件 @
99763132
arch
:
pys2t_transformer_s
encoder-embed-dim
:
256
#pyramid-dropout: 0
pyramid-stages
:
4
pyramid-layers
:
3_3_3_3
pyramid-sr-ratios
:
2_2_1_2
pyramid-embed-dims
:
256_256_256_256
pyramid-fuse
:
True
pyramid-reduced-embed
:
conv
pyramid-embed-norm
:
True
pyramid-position-embed
:
1_1_1_1
pyramid-kernel-sizes
:
5_5_5_5
pyramid-ffn-ratios
:
8_8_8_8
pyramid-heads
:
4_4_4_4
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-pretrained-encoder-from: /home/xuchen/st/checkpoints/mustc/asr/1002_pyramid4_all256_3333_sr8/avg_10_checkpoint.pt
#load-pretrained-encoder-from: /home/xuchen/st/checkpoints/mustc/asr/1002_pyramid4_all256_3333_sr8/checkpoint_best.pt
load-pretrained-encoder-from
:
/home/xuchen/st/checkpoints/mustc/asr/1007_st_pyramid4_all256_3333_sr8_ctc/avg_10_checkpoint.pt
load-pretrained-decoder-from
:
/home/xuchen/st/checkpoints/mustc/mt/st_1003_2349_train_s_baseline/avg_10_checkpoint.pt
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)
criterion
:
label_smoothed_cross_entropy_with_ctc
label_smoothing
:
0.1
conv-channels
:
1024
dropout
:
0.1
activation-fn
:
relu
encoder-ffn-embed-dim
:
2048
encoder-layers
:
12
decoder-layers
:
6
encoder-attention-heads
:
4
decoder-embed-dim
:
256
decoder-ffn-embed-dim
:
2048
decoder-attention-heads
:
4
attention-dropout
:
0.1
activation-dropout
:
0.1
egs/mustc/st/conf/sate_ctc.yaml
查看文件 @
99763132
train-subset
:
train_st
valid-subset
:
dev_st
max-epoch
:
5
0
max-epoch
:
10
0
max-update
:
100000
num-workers
:
8
...
...
@@ -50,8 +50,22 @@ cnn-module-kernel: 31
acoustic-encoder
:
transformer
adapter
:
league
#decoder-embed-dim: 256
#decoder-ffn-embed-dim: 2048
#decoder-attention-heads: 4
#attention-dropout: 0.1
#activation-dropout: 0.1
encoder-embed-dim
:
256
pyramid-stages
:
4
#pyramid-dropout: 0
pyramid-layers
:
3_3_3_3
pyramid-sr-ratios
:
2_2_1_2
pyramid-embed-dims
:
256_256_256_256
pyramid-fuse
:
True
pyramid-reduced-embed
:
conv
pyramid-embed-norm
:
True
pyramid-position-embed
:
1_1_1_1
pyramid-kernel-sizes
:
5_5_5_5
pyramid-ffn-ratios
:
8_8_8_8
pyramid-heads
:
4_4_4_4
decoder-embed-dim
:
256
decoder-ffn-embed-dim
:
2048
decoder-attention-heads
:
4
attention-dropout
:
0.1
activation-dropout
:
0.1
egs/mustc/st/conf/tmp.yaml
deleted
100644 → 0
查看文件 @
5160a9f5
egs/mustc/st/decode.sh
查看文件 @
99763132
...
...
@@ -13,7 +13,7 @@ fi
n_average
=
10
beam_size
=
5
len_penalty
=
1.0
max_tokens
=
1
0000
max_tokens
=
8
0000
dec_model
=
checkpoint_best.pt
cmd
=
"./run.sh
...
...
egs/mustc/st/train.sh
查看文件 @
99763132
...
...
@@ -6,8 +6,16 @@ gpu_num=8
update_freq
=
1
max_tokens
=
40000
exp_tag
=
baseline
exp_tag
=
#config_list=(base)
config_list
=(
ctc
)
#config_list=(sate_ctc)
#config_list=(ctc conformer rpr)
#config_list=(base sate)
#config_list=(pyramid4_base_sr8)
#config_list=(pyramid4_base_sr8 conformer)
# exp full name
exp_name
=
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论