class_docstr: Effective Use of Variational Embedding Capacity for prosody transfer.
  
  See https://arxiv.org/abs/1906.03402
class_docstr_tok: ["Effective","Use","of","Variational","Embedding","Capacity","for","prosody","transfer",".","See","https",":","\/\/arxiv.org\/abs\/1906.03402"]
code: def __init__(
      self,
      num_mel,
      capacitron_VAE_embedding_dim,
      encoder_output_dim=256,
      reference_encoder_out_dim=128,
      speaker_embedding_dim=None,
      text_summary_embedding_dim=None,
  ):
      super().__init__()
      # Init distributions
      self.prior_distribution = MVN(
          torch.zeros(capacitron_VAE_embedding_dim),
          torch.eye(capacitron_VAE_embedding_dim),
      )
      self.approximate_posterior_distribution = None
      # define output ReferenceEncoder dim to the capacitron_VAE_embedding_dim
      self.encoder = ReferenceEncoder(
          num_mel, out_dim=reference_encoder_out_dim
      )
  
      # Init beta, the lagrange-like term for the KL distribution
      self.beta = torch.nn.Parameter(
          torch.log(torch.exp(torch.Tensor([1.0])) - 1),
          requires_grad=True,
      )
      mlp_input_dimension = reference_encoder_out_dim
  
      if text_summary_embedding_dim is not None:
          self.text_summary_net = TextSummary(
              text_summary_embedding_dim,
              encoder_output_dim=encoder_output_dim,
          )
          mlp_input_dimension += text_summary_embedding_dim
      if speaker_embedding_dim is not None:
          # TODO: Test a multispeaker model!
          mlp_input_dimension += speaker_embedding_dim
      self.post_encoder_mlp = PostEncoderMLP(
          mlp_input_dimension, capacitron_VAE_embedding_dim
      )
  
imports: import torch
  from torch import nn
  from torch.distributions.multivariate_normal import MultivariateNormal
  from torch.nn import functional
label_desc: Use image node_id 1 to create a new CapacitronVAE object from inherited base classes: nn with example: obj = CapacitronVAE(num_mel, capacitron_VAE_embedding_dim, encoder_output_dim, reference_encoder_out_dim, speaker_embedding_dim, text_summary_embedding_dim)