class_docstr: AlignTTS with modified duration predictor.
  https://arxiv.org/pdf/2003.01950.pdf
  
  Encoder -> DurationPredictor -> Decoder
  
  Check :class:`AlignTTSArgs` for the class arguments.
  
  Paper Abstract:
      Targeting at both high efficiency and performance, we propose AlignTTS to predict the
      mel-spectrum in parallel. AlignTTS is based on a Feed-Forward Transformer which generates mel-spectrum from a
      sequence of characters, and the duration of each character is determined by a duration predictor.Instead of
      adopting the attention mechanism in Transformer TTS to align text to mel-spectrum, the alignment loss is presented
      to consider all possible alignments in training by use of dynamic programming. Experiments on the LJSpeech dataset s
      how that our model achieves not only state-of-the-art performance which outperforms Transformer TTS by 0.03 in mean
      option score (MOS), but also a high efficiency which is more than 50 times faster than real-time.
  
  Note:
      Original model uses a separate character embedding layer for duration predictor. However, it causes the
      duration predictor to overfit and prevents learning higher level interactions among characters. Therefore,
      we predict durations based on encoder outputs which has higher level information about input characters. This
      enables training without phases as in the original paper.
  
      Original model uses Transormers in encoder and decoder layers. However, here you can set the architecture
      differently based on your requirements using ```encoder_type``` and ```decoder_type``` parameters.
  
  Examples:
      >>> from TTS.tts.configs.align_tts_config import AlignTTSConfig
      >>> config = AlignTTSConfig()
      >>> model = AlignTTS(config)
class_docstr_tok: ["AlignTTS","with","modified","duration","predictor",".","https",":","\/\/arxiv.org\/pdf\/2003.01950.pdf","Encoder","-",">","DurationPredictor","-",">","Decoder","Check",":","class",":","`","AlignTTSArgs","`","for","the","class","arguments",".","Paper","Abstract",":","Targeting","at","both","high","efficiency","and","performance",",","we","propose","AlignTTS","to","predict","the","mel-spectrum","in","parallel",".","AlignTTS","is","based","on","a","Feed-Forward","Transformer","which","generates","mel-spectrum","from","a","sequence","of","characters",",","and","the","duration","of","each","character","is","determined","by","a","duration","predictor.Instead","of","adopting","the","attention","mechanism","in","Transformer","TTS","to","align","text","to","mel-spectrum",",","the","alignment","loss","is","presented","to","consider","all","possible","alignments","in","training","by","use","of","dynamic","programming",".","Experiments","on","the","LJSpeech","dataset","s","how","that","our","model","achieves","not","only","state-of-the-art","performance","which","outperforms","Transformer","TTS","by","0.03","in","mean","option","score","(","MOS",")",",","but","also","a","high","efficiency","which","is","more","than","50","times","faster","than","real-time",".","Note",":","Original","model","uses","a","separate","character","embedding","layer","for","duration","predictor",".","However",",","it","causes","the","duration","predictor","to","overfit","and","prevents","learning","higher","level","interactions","among","characters",".","Therefore",",","we","predict","durations","based","on","encoder","outputs","which","has","higher","level","information","about","input","characters",".","This","enables","training","without","phases","as","in","the","original","paper",".","Original","model","uses","Transormers","in","encoder","and","decoder","layers",".","However",",","here","you","can","set","the","architecture","differently","based","on","your","requirements","using","``","`","encoder_type","``","`","and","``","`","decoder_type","``","`","parameters",".","Examples",":",">",">",">","from","TTS.tts.configs.align_tts_config","import","AlignTTSConfig",">",">",">","config","=","AlignTTSConfig","(",")",">",">",">","model","=","AlignTTS","(","config",")"]
code: def load_checkpoint(
      self, config, checkpoint_path, eval=False, cache=False
  ):  # pylint: disable=unused-argument, redefined-builtin
      state = load_fsspec(
          checkpoint_path, map_location=torch.device("cpu"), cache=cache
      )
      self.load_state_dict(state["model"])
      if eval:
          self.eval()
          assert not self.training
  
imports: from dataclasses import dataclass, field
  from typing import Dict, List, Union
  import torch
  from coqpit import Coqpit
  from torch import nn
  from TTS.tts.layers.align_tts.mdn import MDNBlock
  from TTS.tts.layers.feed_forward.decoder import Decoder
  from TTS.tts.layers.feed_forward.duration_predictor import DurationPredictor
  from TTS.tts.layers.feed_forward.encoder import Encoder
  from TTS.tts.layers.generic.pos_encoding import PositionalEncoding
  from TTS.tts.models.base_tts import BaseTTS
  from TTS.tts.utils.helpers import 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_spectrogram
  from TTS.utils.io import load_fsspec
label_desc: Use image node_id 19 for calling the AlignTTS obj's underlying member method code with example usage: obj.load_checkpoint(config, checkpoint_path, eval, cache) without return types