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 _regularizer(self, mu_z, std_z):
      kld_z = (
          self.z_prior_stdv.log()
          - std_z.log()
          + (std_z**2 + (mu_z.pow(2) - self.z_prior_mean))
          / (2 * self.z_prior_stdv.pow(2))
          - 0.5
      )
      regularizer_loss = kld_z.sum()
  
      regularizer_loss = self.beta * regularizer_loss
  
      cov_mu_z = self._get_covariance_mu_z(mu_z)
  
      if self.mode == "i":
          dipvae_regularizer_loss = self._get_dipvae_regularizer(
              cov_mu_z, self.lambda_offdiag, self.lambda_diag
          )
  
      elif self.mode == "ii":
          cov_z = cov_mu_z + torch.mean(torch.diag(std_z**2), dim=0)
          dipvae_regularizer_loss = self._get_dipvae_regularizer(
              cov_z, self.lambda_offdiag, self.lambda_diag
          )
      else:
          raise NotImplementedError("Unsupported dipvae mode.")
  
      return regularizer_loss + dipvae_regularizer_loss
  
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 8 for calling the DIPVAE obj's underlying member method code with example usage: obj._regularizer(mu_z, std_z) and returns: unknown