Titouan Parcollet/Embedded AI /SRUK/Engineer/Samsung Electronics
commited on
Commit
·
994e8f9
1
Parent(s):
9c041e9
first push
Browse files- asr.ckpt +3 -0
- example.wav +0 -0
- hyperparams.yaml +135 -0
- normalizer.ckpt +3 -0
- tokenizer.ckpt +3 -0
asr.ckpt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b51a1267b9d5f8c770ecb379b30e4f136846ae7ff390cac6036fbe37f947d49f
|
3 |
+
size 1943172966
|
example.wav
ADDED
Binary file (104 kB). View file
|
|
hyperparams.yaml
ADDED
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# ############################################################################
|
2 |
+
# Model: E2E ASR with Transformer
|
3 |
+
# Encoder: Conformer Encoder
|
4 |
+
# Decoder: Transformer Decoder + (CTC/att joint)
|
5 |
+
# Tokens: bpe
|
6 |
+
# losses: CTC + KLdiv (Label Smoothing loss)
|
7 |
+
# Authors: Titouan Parcollet
|
8 |
+
# ############################################################################
|
9 |
+
|
10 |
+
# Feature parameters
|
11 |
+
sample_rate: 16000
|
12 |
+
n_fft: 400
|
13 |
+
n_mels: 80
|
14 |
+
|
15 |
+
|
16 |
+
####################### Model Parameters ###########################
|
17 |
+
# Transformer
|
18 |
+
d_model: 1024
|
19 |
+
nhead: 16
|
20 |
+
num_encoder_layers: 18
|
21 |
+
num_decoder_layers: 6
|
22 |
+
d_ffn: 3072
|
23 |
+
transformer_dropout: 0.1
|
24 |
+
activation: !name:torch.nn.GELU
|
25 |
+
output_neurons: 5120
|
26 |
+
|
27 |
+
# Outputs
|
28 |
+
blank_index: 3
|
29 |
+
label_smoothing: 0.1
|
30 |
+
pad_index: 0
|
31 |
+
bos_index: 1
|
32 |
+
eos_index: 2
|
33 |
+
|
34 |
+
# Decoding parameters
|
35 |
+
min_decode_ratio: 0.0
|
36 |
+
max_decode_ratio: 1.0
|
37 |
+
valid_search_interval: 10
|
38 |
+
valid_beam_size: 1 # We do greedy here so it's faster to decode ...
|
39 |
+
test_beam_size: 80
|
40 |
+
ctc_weight_decode: 0.3
|
41 |
+
scorer_beam_scale: 0.3
|
42 |
+
transformer_beam_search: True
|
43 |
+
|
44 |
+
############################## models ################################
|
45 |
+
|
46 |
+
tokenizer: !new:sentencepiece.SentencePieceProcessor
|
47 |
+
|
48 |
+
normalizer: !new:speechbrain.processing.features.InputNormalization
|
49 |
+
norm_type: global
|
50 |
+
|
51 |
+
compute_features: !new:speechbrain.lobes.features.Fbank
|
52 |
+
sample_rate: !ref <sample_rate>
|
53 |
+
n_fft: !ref <n_fft>
|
54 |
+
n_mels: !ref <n_mels>
|
55 |
+
|
56 |
+
CNN: !new:speechbrain.lobes.models.convolution.ConvolutionFrontEnd
|
57 |
+
input_shape: (8, 10, 80)
|
58 |
+
num_blocks: 2
|
59 |
+
num_layers_per_block: 1
|
60 |
+
out_channels: (64, 32)
|
61 |
+
kernel_sizes: (3, 3)
|
62 |
+
strides: (2, 2)
|
63 |
+
residuals: (False, False)
|
64 |
+
|
65 |
+
Transformer: !new:speechbrain.lobes.models.transformer.TransformerASR.TransformerASR # yamllint disable-line rule:line-length
|
66 |
+
input_size: 640
|
67 |
+
tgt_vocab: !ref <output_neurons>
|
68 |
+
d_model: !ref <d_model>
|
69 |
+
nhead: !ref <nhead>
|
70 |
+
num_encoder_layers: !ref <num_encoder_layers>
|
71 |
+
num_decoder_layers: !ref <num_decoder_layers>
|
72 |
+
d_ffn: !ref <d_ffn>
|
73 |
+
dropout: !ref <transformer_dropout>
|
74 |
+
conformer_activation: !ref <activation>
|
75 |
+
activation: !ref <activation>
|
76 |
+
encoder_module: conformer
|
77 |
+
attention_type: RelPosMHAXL
|
78 |
+
normalize_before: True
|
79 |
+
causal: False
|
80 |
+
|
81 |
+
ctc_lin: !new:speechbrain.nnet.linear.Linear
|
82 |
+
input_size: !ref <d_model>
|
83 |
+
n_neurons: !ref <output_neurons>
|
84 |
+
|
85 |
+
seq_lin: !new:speechbrain.nnet.linear.Linear
|
86 |
+
input_size: !ref <d_model>
|
87 |
+
n_neurons: !ref <output_neurons>
|
88 |
+
|
89 |
+
asr_model: !new:torch.nn.ModuleList
|
90 |
+
- [!ref <CNN>, !ref <Transformer>, !ref <seq_lin>, !ref <ctc_lin>]
|
91 |
+
|
92 |
+
# Scorer
|
93 |
+
ctc_scorer: !new:speechbrain.decoders.scorer.CTCScorer
|
94 |
+
eos_index: !ref <eos_index>
|
95 |
+
blank_index: !ref <blank_index>
|
96 |
+
ctc_fc: !ref <ctc_lin>
|
97 |
+
|
98 |
+
scorer: !new:speechbrain.decoders.scorer.ScorerBuilder
|
99 |
+
full_scorers: [!ref <ctc_scorer>]
|
100 |
+
weights:
|
101 |
+
ctc: !ref <ctc_weight_decode>
|
102 |
+
scorer_beam_scale: !ref <scorer_beam_scale>
|
103 |
+
|
104 |
+
# We compose the inference (encoder) pipeline.
|
105 |
+
encoder: !new:speechbrain.nnet.containers.LengthsCapableSequential
|
106 |
+
input_shape: [null, null, !ref <n_mels>]
|
107 |
+
compute_features: !ref <compute_features>
|
108 |
+
normalize: !ref <normalizer>
|
109 |
+
CNN: !ref <CNN>
|
110 |
+
|
111 |
+
decoder: !new:speechbrain.decoders.S2STransformerBeamSearcher
|
112 |
+
modules: [!ref <Transformer>, !ref <seq_lin>]
|
113 |
+
bos_index: !ref <bos_index>
|
114 |
+
eos_index: !ref <eos_index>
|
115 |
+
min_decode_ratio: !ref <min_decode_ratio>
|
116 |
+
max_decode_ratio: !ref <max_decode_ratio>
|
117 |
+
beam_size: 3
|
118 |
+
temperature: 1.15
|
119 |
+
using_eos_threshold: True
|
120 |
+
scorer: !ref <scorer>
|
121 |
+
|
122 |
+
modules:
|
123 |
+
normalizer: !ref <normalizer>
|
124 |
+
encoder: !ref <encoder>
|
125 |
+
transformer: !ref <Transformer>
|
126 |
+
decoder: !ref <decoder>
|
127 |
+
|
128 |
+
log_softmax: !new:torch.nn.LogSoftmax
|
129 |
+
dim: -1
|
130 |
+
|
131 |
+
pretrainer: !new:speechbrain.utils.parameter_transfer.Pretrainer
|
132 |
+
loadables:
|
133 |
+
normalizer: !ref <normalizer>
|
134 |
+
asr: !ref <asr_model>
|
135 |
+
tokenizer: !ref <tokenizer>
|
normalizer.ckpt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:eda13a16647a5d3cad4681ffb158df5795cbd479636f59b98d7b380819db2983
|
3 |
+
size 2218
|
tokenizer.ckpt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1a16e33c18124234c5c4998f54344c987dbc98736a75a78056d63e58c88da04c
|
3 |
+
size 319849
|