class_docstr: Disentangled Inferred Prior-VAE or DIPVAE [1] is a Variational Autoencoder [2]_ variant that leads to a
  disentangled latent space. This is achieved by matching the covariance of the prior distributions with the
  inferred prior.
  
  References:
      .. [1] Variational Inference of Disentangled Latent Concepts from Unlabeled Observations (DIP-VAE), ICLR 2018.
       Kumar, Sattigeri, Balakrishnan. https://arxiv.org/abs/1711.00848
      .. [2] Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. ICLR, 2014
code: def __init__(
      self,
      num_nodes=50,
      latent_dim=10,
      op_dim=784,
      activation_type="relu",
      args=None,
      cuda_available=None,
      init_networks=True,
      mode=None,
      output_activation_type=None,
      likelihood_type=None,
      beta=1.0,
  ):
      super(DIPVAE, self).__init__()
      self.latent_dim = latent_dim
      self.mode = mode
  
      if init_networks:
          args.num_layers = args.num_gen_layers
          generative_op_dim = op_dim
          self.generative_net = FCNet(
              num_nodes=num_nodes,
              op_dim=generative_op_dim,
              ip_dim=latent_dim,
              activation_type=activation_type,
              args=args,
          )
          args.num_layers = args.num_inference_layers
          self.inference_net = FCNet(
              num_nodes=num_nodes,
              op_dim=2 * latent_dim,
              ip_dim=op_dim,
              activation_type=activation_type,
              args=args,
          )
      self.z_prior_stdv = torch.Tensor([1.0])
      self.z_prior_mean = torch.Tensor([0.0])
      if cuda_available:
          self.z_prior_stdv = self.z_prior_stdv.cuda()
          self.z_prior_mean = self.z_prior_mean.cuda()
      self.cuda_available = cuda_available
      self.name = "DIPVAE"
      self.args = args
  
      self.beta = beta
  
      self.lambda_diag_factor = args.lambda_diag_factor
      self.lambda_offdiag = args.lambda_offdiag
      self.lambda_diag = self.lambda_diag_factor * self.lambda_offdiag
  
      self.output_activation_type = output_activation_type
      if likelihood_type == "bernoulli":
          self.likelihood = bernoulli_likelihood
      elif likelihood_type == "gaussian":
          self.likelihood = gaussian_likelihood
      else:
          raise NotImplementedError("Unsupported likelihood type.")
  
imports: import matplotlib
  import matplotlib.pyplot
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.autograd import Variable
  from torch.nn import Linear
  import os
label_desc: Use image node_id 1 to create a new DIPVAE object from inherited base classes: nn with example: obj = DIPVAE(num_nodes, latent_dim, op_dim, activation_type, args, cuda_available, init_networks, mode, output_activation_type, likelihood_type, beta)