Rin Arakaki
2024-12-24 1367973f9818d8e15c7bf52ad6ffba4ddb6ac2b2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
 
# network architecture
model: SanmKWS
model_conf:
    ctc_weight: 1.0
 
# encoder
encoder: SANMEncoder
encoder_conf:
    output_size: 256    # dimension of attention
    attention_heads: 4
    linear_units: 320  # the number of units of position-wise feed forward
    num_blocks: 6      # the number of encoder blocks
    dropout_rate: 0.1
    positional_dropout_rate: 0.1
    attention_dropout_rate: 0.1
    input_layer: pe
    pos_enc_class: SinusoidalPositionEncoder
    normalize_before: true
    kernel_size: 11
    sanm_shift: 0
    selfattention_layer_type: sanm
 
# frontend related
frontend: WavFrontend
frontend_conf:
    fs: 16000
    window: hamming
    n_mels: 40
    frame_length: 25
    frame_shift: 10
    lfr_m: 7
    lfr_n: 6
 
specaug: SpecAugLFR
specaug_conf:
    apply_time_warp: false
    time_warp_window: 5
    time_warp_mode: bicubic
    apply_freq_mask: true
    freq_mask_width_range:
    - 0
    - 30
    lfr_rate: 6
    num_freq_mask: 1
    apply_time_mask: true
    time_mask_width_range:
    - 0
    - 12
    num_time_mask: 1
 
train_conf:
  accum_grad: 1
  grad_clip: 5
  max_epoch: 100
  keep_nbest_models: 20
  avg_nbest_model: 10
  avg_keep_nbest_models_type: loss
  validate_interval: 50000
  save_checkpoint_interval: 50000
  avg_checkpoint_interval: 1000
  log_interval: 50
 
optim: adam
optim_conf:
   lr: 0.001
scheduler: warmuplr
scheduler_conf:
   warmup_steps: 10000
 
dataset: AudioDataset
dataset_conf:
    index_ds: IndexDSJsonl
    batch_sampler: EspnetStyleBatchSampler
    batch_type: length # example or length
    batch_size: 96000 # if batch_type is example, batch_size is the numbers of samples; if length, batch_size is source_token_len+target_token_len;
    max_token_length: 1600 # filter samples if source_token_len+target_token_len > max_token_length,
    buffer_size: 2048
    shuffle: true
    num_workers: 8
    preprocessor_speech: SpeechPreprocessSpeedPerturb
    preprocessor_speech_conf:
      speed_perturb: [0.9, 1.0, 1.1]
 
tokenizer: CharTokenizer
tokenizer_conf:
  unk_symbol: <unk>
 
ctc_conf:
    dropout_rate: 0.0
    ctc_type: builtin  # ctc_type: focalctc, builtin
    reduce: true
    ignore_nan_grad: true
normalize: null