code: def __init__(
      self,
      k,
      user_encoder_structure,
      item_encoder_structure,
      act_fn,
      likelihood,
      cap_priors,
      feature_dim,
      batch_size,
  ):
      super(BiVAE, self).__init__()
  
      self.mu_theta = torch.zeros(
          (item_encoder_structure[0], k)
      )  # n_users*k
      self.mu_beta = torch.zeros(
          (user_encoder_structure[0], k)
      )  # n_items*k
  
      self.theta = torch.randn(item_encoder_structure[0], k) * 0.01
      self.beta = torch.randn(user_encoder_structure[0], k) * 0.01
      torch.nn.init.kaiming_uniform_(self.theta, a=np.sqrt(5))
  
      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()))
  
      self.cap_priors = cap_priors
      if self.cap_priors.get("user", False):
          self.user_prior_encoder = nn.Linear(
              feature_dim.get("user"), k
          )
      if self.cap_priors.get("item", False):
          self.item_prior_encoder = nn.Linear(
              feature_dim.get("item"), k
          )
  
      # User Encoder
      self.user_encoder = nn.Sequential()
      for i in range(len(user_encoder_structure) - 1):
          self.user_encoder.add_module(
              "fc{}".format(i),
              nn.Linear(
                  user_encoder_structure[i],
                  user_encoder_structure[i + 1],
              ),
          )
          self.user_encoder.add_module("act{}".format(i), self.act_fn)
      self.user_mu = nn.Linear(user_encoder_structure[-1], k)  # mu
      self.user_std = nn.Linear(user_encoder_structure[-1], k)
  
      # Item Encoder
      self.item_encoder = nn.Sequential()
      for i in range(len(item_encoder_structure) - 1):
          self.item_encoder.add_module(
              "fc{}".format(i),
              nn.Linear(
                  item_encoder_structure[i],
                  item_encoder_structure[i + 1],
              ),
          )
          self.item_encoder.add_module("act{}".format(i), self.act_fn)
      self.item_mu = nn.Linear(item_encoder_structure[-1], k)  # mu
      self.item_std = nn.Linear(item_encoder_structure[-1], k)
  
file_path: cornac/cornac/models/bivaecf/bivae.py
imports: import itertools
  import numpy
  import torch
  import torch.nn
  from tqdm.auto import trange
label_desc: Use image node_id 1 to create a new BiVAE object from inherited base classes: nn with example: obj = BiVAE(k, user_encoder_structure, item_encoder_structure, act_fn, likelihood, cap_priors, feature_dim, batch_size)