class_docstr: OverFlow TTS model.
  
  Paper::
      https://arxiv.org/abs/2211.06892
  
  Paper abstract::
      Neural HMMs are a type of neural transducer recently proposed for
  sequence-to-sequence modelling in text-to-speech. They combine the best features
  of classic statistical speech synthesis and modern neural TTS, requiring less
  data and fewer training updates, and are less prone to gibberish output caused
  by neural attention failures. In this paper, we combine neural HMM TTS with
  normalising flows for describing the highly non-Gaussian distribution of speech
  acoustics. The result is a powerful, fully probabilistic model of durations and
  acoustics that can be trained using exact maximum likelihood. Compared to
  dominant flow-based acoustic models, our approach integrates autoregression for
  improved modelling of long-range dependences such as utterance-level prosody.
  Experiments show that a system based on our proposal gives more accurate
  pronunciations and better subjective speech quality than comparable methods,
  whilst retaining the original advantages of neural HMMs. Audio examples and code
  are available at https://shivammehta25.github.io/OverFlow/.
  
  Note:
      - Neural HMMs uses flat start initialization i.e it computes the means and std and transition probabilities
      of the dataset and uses them to initialize the model. This benefits the model and helps with faster learning
      If you change the dataset or want to regenerate the parameters change the `force_generate_statistics` and
      `mel_statistics_parameter_path` accordingly.
  
      - To enable multi-GPU training, set the `use_grad_checkpointing=False` in config.
      This will significantly increase the memory usage.  This is because to compute
      the actual data likelihood (not an approximation using MAS/Viterbi) we must use
      all the states at the previous time step during the forward pass to decide the
      probability distribution at the current step i.e the difference between the forward
      algorithm and viterbi approximation.
  
  Check :class:`TTS.tts.configs.overflow.OverFlowConfig` for class arguments.
class_docstr_tok: ["OverFlow","TTS","model",".","Paper",":",":","https",":","\/\/arxiv.org\/abs\/2211.06892","Paper","abstract",":",":","Neural","HMMs","are","a","type","of","neural","transducer","recently","proposed","for","sequence-to-sequence","modelling","in","text-to-speech",".","They","combine","the","best","features","of","classic","statistical","speech","synthesis","and","modern","neural","TTS",",","requiring","less","data","and","fewer","training","updates",",","and","are","less","prone","to","gibberish","output","caused","by","neural","attention","failures",".","In","this","paper",",","we","combine","neural","HMM","TTS","with","normalising","flows","for","describing","the","highly","non-Gaussian","distribution","of","speech","acoustics",".","The","result","is","a","powerful",",","fully","probabilistic","model","of","durations","and","acoustics","that","can","be","trained","using","exact","maximum","likelihood",".","Compared","to","dominant","flow-based","acoustic","models",",","our","approach","integrates","autoregression","for","improved","modelling","of","long-range","dependences","such","as","utterance-level","prosody",".","Experiments","show","that","a","system","based","on","our","proposal","gives","more","accurate","pronunciations","and","better","subjective","speech","quality","than","comparable","methods",",","whilst","retaining","the","original","advantages","of","neural","HMMs",".","Audio","examples","and","code","are","available","at","https",":","\/\/shivammehta25.github.io\/OverFlow\/",".","Note",":","-","Neural","HMMs","uses","flat","start","initialization","i.e","it","computes","the","means","and","std","and","transition","probabilities","of","the","dataset","and","uses","them","to","initialize","the","model",".","This","benefits","the","model","and","helps","with","faster","learning","If","you","change","the","dataset","or","want","to","regenerate","the","parameters","change","the","`","force_generate_statistics","`","and","`","mel_statistics_parameter_path","`","accordingly",".","-","To","enable","multi-GPU","training",",","set","the","`","use_grad_checkpointing=False","`","in","config",".","This","will","significantly","increase","the","memory","usage",".","This","is","because","to","compute","the","actual","data","likelihood","(","not","an","approximation","using","MAS\/Viterbi",")","we","must","use","all","the","states","at","the","previous","time","step","during","the","forward","pass","to","decide","the","probability","distribution","at","the","current","step","i.e","the","difference","between","the","forward","algorithm","and","viterbi","approximation",".","Check",":","class",":","`","TTS.tts.configs.overflow.OverFlowConfig","`","for","class","arguments","."]
code: def update_mean_std(self, statistics_dict: Dict):
      self.mean.data = torch.tensor(statistics_dict["mean"])
      self.std.data = torch.tensor(statistics_dict["std"])
  
imports: import os
  from typing import Dict, List, Union
  import torch
  from coqpit import Coqpit
  from torch import nn
  from trainer.logging.tensorboard_logger import TensorboardLogger
  from TTS.tts.layers.overflow.common_layers import Encoder, OverflowUtils
  from TTS.tts.layers.overflow.decoder import Decoder
  from TTS.tts.layers.overflow.neural_hmm import NeuralHMM
  from TTS.tts.layers.overflow.plotting_utils import get_spec_from_most_probable_state, plot_transition_probabilities_to_numpy
  from TTS.tts.models.base_tts import BaseTTS
  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.generic_utils import format_aux_input
  from TTS.utils.io import load_fsspec
label_desc: Use image node_id 2 for calling the Overflow obj's underlying member method code with example usage: obj.update_mean_std(statistics_dict) without return types