class_docstr: Variational Autoencoder [1]_ is an generative model with stochastic encoder and decoder learned using Bayesian
  variational inference. The encoder network is used to obtain latent representations for the input while the decoder
  generated the samples from the latents.
  
  References:
      .. [1] 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,
  ):
      super(VAE, self).__init__()
      self.latent_dim = latent_dim
  
      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 = "VAE"
      self.args = args
  
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 VAE object from inherited base classes: nn with example: obj = VAE(num_nodes, latent_dim, op_dim, activation_type, args, cuda_available, init_networks)