class_docstr: General forward TTS model implementation that uses an encoder-decoder architecture with an optional alignment
  network and a pitch predictor.
  
  If the alignment network is used, the model learns the text-to-speech alignment
  from the data instead of using pre-computed durations.
  
  If the pitch predictor is used, the model trains a pitch predictor that predicts average pitch value for each
  input character as in the FastPitch model.
  
  `ForwardTTS` can be configured to one of these architectures,
  
      - FastPitch
      - SpeedySpeech
      - FastSpeech
      - FastSpeech2 (requires average speech energy predictor)
  
  Args:
      config (Coqpit): Model coqpit class.
      speaker_manager (SpeakerManager): Speaker manager for multi-speaker training. Only used for multi-speaker models.
          Defaults to None.
  
  Examples:
      >>> from TTS.tts.models.fast_pitch import ForwardTTS, ForwardTTSArgs
      >>> config = ForwardTTSArgs()
      >>> model = ForwardTTS(config)
class_docstr_tok: ["General","forward","TTS","model","implementation","that","uses","an","encoder-decoder","architecture","with","an","optional","alignment","network","and","a","pitch","predictor",".","If","the","alignment","network","is","used",",","the","model","learns","the","text-to-speech","alignment","from","the","data","instead","of","using","pre-computed","durations",".","If","the","pitch","predictor","is","used",",","the","model","trains","a","pitch","predictor","that","predicts","average","pitch","value","for","each","input","character","as","in","the","FastPitch","model",".","`","ForwardTTS","`","can","be","configured","to","one","of","these","architectures",",","-","FastPitch","-","SpeedySpeech","-","FastSpeech","-","FastSpeech2","(","requires","average","speech","energy","predictor",")","Args",":","config","(","Coqpit",")",":","Model","coqpit","class",".","speaker_manager","(","SpeakerManager",")",":","Speaker","manager","for","multi-speaker","training",".","Only","used","for","multi-speaker","models",".","Defaults","to","None",".","Examples",":",">",">",">","from","TTS.tts.models.fast_pitch","import","ForwardTTS",",","ForwardTTSArgs",">",">",">","config","=","ForwardTTSArgs","(",")",">",">",">","model","=","ForwardTTS","(","config",")"]
docstr: Initiate model from config
  
  Args:
      config (ForwardTTSConfig): Model config.
      samples (Union[List[List], List[Dict]]): Training samples to parse speaker ids for training.
          Defaults to None.
code: def init_from_config(
      config: "ForwardTTSConfig",
      samples: Union[List[List], List[Dict]] = None,
  ):
      """Initiate model from config
  
      Args:
          config (ForwardTTSConfig): Model config.
          samples (Union[List[List], List[Dict]]): Training samples to parse speaker ids for training.
              Defaults to None.
      """
      from TTS.utils.audio import AudioProcessor
  
      ap = AudioProcessor.init_from_config(config)
      tokenizer, new_config = TTSTokenizer.init_from_config(config)
      speaker_manager = SpeakerManager.init_from_config(config, samples)
      return ForwardTTS(new_config, ap, tokenizer, speaker_manager)
  
imports: from dataclasses import dataclass, field
  from typing import Dict, List, Tuple, Union
  import torch
  from coqpit import Coqpit
  from torch import nn
  from torch.cuda.amp.autocast_mode import autocast
  from TTS.tts.layers.feed_forward.decoder import Decoder
  from TTS.tts.layers.feed_forward.encoder import Encoder
  from TTS.tts.layers.generic.aligner import AlignmentNetwork
  from TTS.tts.layers.generic.pos_encoding import PositionalEncoding
  from TTS.tts.layers.glow_tts.duration_predictor import DurationPredictor
  from TTS.tts.models.base_tts import BaseTTS
  from TTS.tts.utils.helpers import average_over_durations, generate_path, maximum_path, sequence_mask
  from TTS.tts.utils.speakers import SpeakerManager
  from TTS.tts.utils.text.tokenizer import TTSTokenizer
  from TTS.tts.utils.visual import plot_alignment, plot_avg_energy, plot_avg_pitch, plot_spectrogram
  from TTS.utils.io import load_fsspec
label_desc: Use image node_id 22 for calling the ForwardTTS obj's underlying member method code with example usage: obj.init_from_config(config, samples) and returns: ForwardTTS