# ############################################################################ # Model: E2E ST JA->EN with Conformer # Encoder: Conformer Encoder # Decoder: Conformer Decoder + (CTC/ATT joint) # Tokens: BPE # losses: CTC # Training: Custom JA->EN youtube scrape, ~600h # Authors: Eric Engelhart, 2022 # ############################################################################ # Tokenier initialization tokenizer: !new:sentencepiece.SentencePieceProcessor # Features sample_rate: 16000 n_fft: 400 n_mels: 80 # normalization 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 ####################### Model parameters ########################### # Transformer d_model: 384 nhead: 6 num_encoder_layers: 12 num_decoder_layers: 6 d_ffn: 1536 transformer_dropout: 0.1 activation: !name:torch.nn.GELU output_neurons: 5000 vocab_size: 5000 attention_type: "regularMHA" # "RelPosMHAXL" or "regularMHA" kernel_size: 15 encoder_module: conformer # Outputs blank_index: 0 label_smoothing: 0.1 pad_index: 0 bos_index: 1 eos_index: 2 unk_index: 0 # Decoding parameters min_decode_ratio: 0.0 max_decode_ratio: 1.0 valid_search_interval: 2 valid_beam_size: 1 test_beam_size: 25 ############################## models ################################ CNN: !new:speechbrain.lobes.models.convolution.ConvolutionFrontEnd input_shape: (8, 10, 80) num_blocks: 2 num_layers_per_block: 1 out_channels: (256, 256) kernel_sizes: (3, 3) strides: (2, 2) residuals: (False, False) Transformer: !new:speechbrain.lobes.models.transformer.TransformerST.TransformerST # 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 ctc_weight: 0 asr_weight: 0 mt_weight: 0 asr_tgt_vocab: !ref mt_src_vocab: !ref attention_type: !ref kernel_size: !ref encoder_module: !ref normalize_before: True causal: False max_length: 5000 # only when multi-task setting is used 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 # when asr-weight > 0 and ctc-weight < 1 asr_seq_lin: !new:speechbrain.nnet.linear.Linear input_size: !ref n_neurons: !ref st_model: !new:torch.nn.ModuleList - [!ref , !ref , !ref ] Tencoder: !new:speechbrain.lobes.models.transformer.TransformerASR.EncoderWrapper transformer: !ref encoder: !new:speechbrain.nnet.containers.LengthsCapableSequential input_shape: [null, null, !ref ] compute_features: !ref normalize: !ref cnn: !ref transformer_encoder: !ref decoder: !new:speechbrain.decoders.S2STransformerBeamSearch modules: [!ref , !ref , null] bos_index: !ref eos_index: !ref blank_index: !ref min_decode_ratio: !ref max_decode_ratio: !ref beam_size: !ref using_eos_threshold: True length_normalization: True ctc_weight: 0 lm_weight: 0 modules: compute_features: !ref normalizer: !ref pre_transformer: !ref Transformer: !ref asr_model: !ref encoder: !ref decoder: !ref log_softmax: !new:torch.nn.LogSoftmax dim: -1 # The pretrainer allows a mapping between pretrained files and instances that # are declared in the yaml. pretrainer: !new:speechbrain.utils.parameter_transfer.Pretrainer loadables: tokenizer: !ref st: !ref normalizer: !ref