class_docstr: Speedy Speech model
  https://arxiv.org/abs/2008.03802
  
  Encoder -> DurationPredictor -> Decoder
  
  This model is able to achieve a reasonable performance with only
  ~3M model parameters and convolutional layers.
  
  This model requires precomputed phoneme durations to train a duration predictor. At inference
  it only uses the duration predictor to compute durations and expand encoder outputs respectively.
  
  Args:
      num_chars (int): number of unique input to characters
      out_channels (int): number of output tensor channels. It is equal to the expected spectrogram size.
      hidden_channels (int): number of channels in all the model layers.
      positional_encoding (bool, optional): enable/disable Positional encoding on encoder outputs. Defaults to True.
      length_scale (int, optional): coefficient to set the speech speed. <1 slower, >1 faster. Defaults to 1.
      encoder_type (str, optional): set the encoder type. Defaults to 'residual_conv_bn'.
      encoder_params (dict, optional): set encoder parameters depending on 'encoder_type'. Defaults to { "kernel_size": 4, "dilations": 4 * [1, 2, 4] + [1], "num_conv_blocks": 2, "num_res_blocks": 13 }.
      decoder_type (str, optional): decoder type. Defaults to 'residual_conv_bn'.
      decoder_params (dict, optional): set decoder parameters depending on 'decoder_type'. Defaults to { "kernel_size": 4, "dilations": 4 * [1, 2, 4, 8] + [1], "num_conv_blocks": 2, "num_res_blocks": 17 }.
      num_speakers (int, optional): number of speakers for multi-speaker training. Defaults to 0.
      external_c (bool, optional): enable external speaker embeddings. Defaults to False.
      c_in_channels (int, optional): number of channels in speaker embedding vectors. Defaults to 0.
class_docstr_tok: ["Speedy","Speech","model","https",":","\/\/arxiv.org\/abs\/2008.03802","Encoder","-",">","DurationPredictor","-",">","Decoder","This","model","is","able","to","achieve","a","reasonable","performance","with","only","~3M","model","parameters","and","convolutional","layers",".","This","model","requires","precomputed","phoneme","durations","to","train","a","duration","predictor",".","At","inference","it","only","uses","the","duration","predictor","to","compute","durations","and","expand","encoder","outputs","respectively",".","Args",":","num_chars","(","int",")",":","number","of","unique","input","to","characters","out_channels","(","int",")",":","number","of","output","tensor","channels",".","It","is","equal","to","the","expected","spectrogram","size",".","hidden_channels","(","int",")",":","number","of","channels","in","all","the","model","layers",".","positional_encoding","(","bool",",","optional",")",":","enable\/disable","Positional","encoding","on","encoder","outputs",".","Defaults","to","True",".","length_scale","(","int",",","optional",")",":","coefficient","to","set","the","speech","speed",".","<","1","slower",",",">","1","faster",".","Defaults","to","1.","encoder_type","(","str",",","optional",")",":","set","the","encoder","type",".","Defaults","to","'residual_conv_bn","'",".","encoder_params","(","dict",",","optional",")",":","set","encoder","parameters","depending","on","'encoder_type","'",".","Defaults","to","{","``","kernel_size","''",":","4",",","``","dilations","''",":","4","*","[","1",",","2",",","4","]","+","[","1","]",",","``","num_conv_blocks","''",":","2",",","``","num_res_blocks","''",":","13","}",".","decoder_type","(","str",",","optional",")",":","decoder","type",".","Defaults","to","'residual_conv_bn","'",".","decoder_params","(","dict",",","optional",")",":","set","decoder","parameters","depending","on","'decoder_type","'",".","Defaults","to","{","``","kernel_size","''",":","4",",","``","dilations","''",":","4","*","[","1",",","2",",","4",",","8","]","+","[","1","]",",","``","num_conv_blocks","''",":","2",",","``","num_res_blocks","''",":","17","}",".","num_speakers","(","int",",","optional",")",":","number","of","speakers","for","multi-speaker","training",".","Defaults","to","0.","external_c","(","bool",",","optional",")",":","enable","external","speaker","embeddings",".","Defaults","to","False",".","c_in_channels","(","int",",","optional",")",":","number","of","channels","in","speaker","embedding","vectors",".","Defaults","to","0","."]
code: def __init__(
      self,
      num_chars,
      out_channels,
      hidden_channels,
      positional_encoding=True,
      length_scale=1,
      encoder_type="residual_conv_bn",
      encoder_params={
          "kernel_size": 4,
          "dilations": 4 * [1, 2, 4] + [1],
          "num_conv_blocks": 2,
          "num_res_blocks": 13,
      },
      decoder_type="residual_conv_bn",
      decoder_params={
          "kernel_size": 4,
          "dilations": 4 * [1, 2, 4, 8] + [1],
          "num_conv_blocks": 2,
          "num_res_blocks": 17,
      },
      num_speakers=0,
      external_c=False,
      c_in_channels=0,
  ):
      super().__init__()
      self.length_scale = (
          float(length_scale)
          if isinstance(length_scale, int)
          else length_scale
      )
      self.emb = nn.Embedding(num_chars, hidden_channels)
      self.encoder = Encoder(
          hidden_channels,
          hidden_channels,
          encoder_type,
          encoder_params,
          c_in_channels,
      )
      if positional_encoding:
          self.pos_encoder = PositionalEncoding(hidden_channels)
      self.decoder = Decoder(
          out_channels, hidden_channels, decoder_type, decoder_params
      )
      self.duration_predictor = DurationPredictor(
          hidden_channels + c_in_channels
      )
  
      if num_speakers > 1 and not external_c:
          # speaker embedding layer
          self.emb_g = nn.Embedding(num_speakers, c_in_channels)
          nn.init.uniform_(self.emb_g.weight, -0.1, 0.1)
  
      if c_in_channels > 0 and c_in_channels != hidden_channels:
          self.proj_g = nn.Conv1d(c_in_channels, hidden_channels, 1)
  
file_path: TTS/TTS/tts/models/speedy_speech.py
imports: import torch
  from torch import nn
  from TTS.tts.layers.speedy_speech.decoder import Decoder
  from TTS.tts.layers.speedy_speech.duration_predictor import DurationPredictor
  from TTS.tts.layers.speedy_speech.encoder import Encoder, PositionalEncoding
  from TTS.tts.utils.generic_utils import sequence_mask
  from TTS.tts.layers.glow_tts.monotonic_align import generate_path
label_desc: Use image node_id 1 to create a new SpeedySpeech object from inherited base classes: nn with example: obj = SpeedySpeech(num_chars, out_channels, hidden_channels, positional_encoding, length_scale, encoder_type, encoder_params, decoder_type, decoder_params, num_speakers, external_c, c_in_channels)