code: def loss(self, x, x_, mu, mu_prior, std, kl_beta):
      # Likelihood
      ll_choices = {
          "bern": x * torch.log(x_ + EPS)
          + (1 - x) * torch.log(1 - x_ + EPS),
          "gaus": -((x - x_) ** 2),
          "pois": x * torch.log(x_ + EPS) - x_,
      }
  
      ll = ll_choices.get(self.likelihood, None)
      if ll is None:
          raise ValueError(
              "Supported likelihoods: {}".format(ll_choices.keys())
          )
  
      ll = torch.sum(ll, dim=1)
  
      # KL term
      kld = -0.5 * (
          1 + 2.0 * torch.log(std) - (mu - mu_prior).pow(2) - std.pow(2)
      )
      kld = torch.sum(kld, dim=1)
  
      return torch.mean(kl_beta * kld - ll)
  
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 11 for calling the BiVAE obj's underlying member method code with example usage: obj.loss(x, x_, mu, mu_prior, std, kl_beta) and returns: torch