# ################################ # Model: Transformer ASR # Augmentation: SpecAugment # Authors: Pooneh Mousavi 2023 # ################################ # Feature parameters (FBANKS etc) sample_rate: 16000 n_fft: 400 n_mels: 80 # Model parameters # Transformer d_model: 768 nhead: 8 num_encoder_layers: 12 num_decoder_layers: 6 d_ffn: 3072 transformer_dropout: 0.0 activation: !name:torch.nn.GELU output_neurons: 500 # Outputs blank_index: 0 label_smoothing: 0.1 pad_index: 0 bos_index: 1 eos_index: 2 # Decoding parameters min_decode_ratio: 0.0 max_decode_ratio: 1.0 valid_search_interval: 5 valid_beam_size: 10 test_beam_size: 80 ctc_weight_decode: 0.3 scorer_beam_scale: 0.3 transformer_beam_search: True normalizer: !new:speechbrain.processing.features.InputNormalization norm_type: global compute_features: !new:speechbrain.lobes.features.Fbank sample_rate: !ref n_fft: !ref n_mels: !ref CNN: !new:speechbrain.lobes.models.convolution.ConvolutionFrontEnd input_shape: (8, 10, 80) num_blocks: 3 num_layers_per_block: 1 out_channels: (128, 200, 256) kernel_sizes: (3, 3, 1) strides: (2, 2, 1) residuals: (False, False, False) Transformer: !new:speechbrain.lobes.models.transformer.TransformerASR.TransformerASR # yamllint disable-line rule:line-length input_size: 5120 tgt_vocab: !ref d_model: !ref nhead: !ref num_encoder_layers: !ref num_decoder_layers: !ref d_ffn: !ref dropout: !ref activation: !ref normalize_before: False causal: False ctc_lin: !new:speechbrain.nnet.linear.Linear input_size: !ref n_neurons: !ref seq_lin: !new:speechbrain.nnet.linear.Linear input_size: !ref n_neurons: !ref log_softmax: !new:speechbrain.nnet.activations.Softmax apply_log: True # Scorer ctc_scorer: !new:speechbrain.decoders.scorer.CTCScorer eos_index: !ref blank_index: !ref ctc_fc: !ref scorer: !new:speechbrain.decoders.scorer.ScorerBuilder full_scorers: [!ref ] weights: ctc: !ref scorer_beam_scale: !ref asr_model: !new:torch.nn.ModuleList - [!ref , !ref , !ref , !ref ] tokenizer: !new:sentencepiece.SentencePieceProcessor # We compose the inference (encoder) pipeline. encoder: !new:speechbrain.nnet.containers.LengthsCapableSequential input_shape: [null, null, !ref ] compute_features: !ref normalize: !ref CNN: !ref decoder: !new:speechbrain.decoders.S2STransformerBeamSearcher modules: [!ref , !ref ] bos_index: !ref eos_index: !ref min_decode_ratio: !ref max_decode_ratio: !ref beam_size: !ref temperature: 1.15 using_eos_threshold: True scorer: !ref modules: normalizer: !ref encoder: !ref transformer: !ref decoder: !ref pretrainer: !new:speechbrain.utils.parameter_transfer.Pretrainer loadables: normalizer: !ref asr: !ref tokenizer: !ref