code: def __init__(self, z_dim, ae_structure, act_fn, likelihood):
      super(VAE, self).__init__()
  
      self.likelihood = likelihood
      self.act_fn = ACT.get(act_fn, None)
      if self.act_fn is None:
          raise ValueError("Supported act_fn: {}".format(ACT.keys()))
  
      # Encoder
      self.encoder = nn.Sequential()
      for i in range(len(ae_structure) - 1):
          self.encoder.add_module(
              "fc{}".format(i),
              nn.Linear(ae_structure[i], ae_structure[i + 1]),
          )
          self.encoder.add_module("act{}".format(i), self.act_fn)
      self.enc_mu = nn.Linear(ae_structure[-1], z_dim)  # mu
      self.enc_logvar = nn.Linear(ae_structure[-1], z_dim)  # logvar
  
      # Decoder
      ae_structure = [z_dim] + ae_structure[::-1]
      self.decoder = nn.Sequential()
      for i in range(len(ae_structure) - 1):
          self.decoder.add_module(
              "fc{}".format(i),
              nn.Linear(ae_structure[i], ae_structure[i + 1]),
          )
          if i != len(ae_structure) - 2:
              self.decoder.add_module("act{}".format(i), self.act_fn)
  
file_path: cornac/cornac/models/vaecf/vaecf.py
imports: import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from tqdm.auto import trange
  from ...utils import estimate_batches
label_desc: Use image node_id 1 to create a new VAE object from inherited base classes: nn with example: obj = VAE(z_dim, ae_structure, act_fn, likelihood)