code: def iwae(qz_x, px_z, zs, x):
      """IWAE estimate for log p_\theta(x) -- fully vectorised."""
      lpz = model.pz(*model.pz_params).log_prob(zs).sum(-1)
      lpx_z = (
          px_z.log_prob(x).view(*px_z.batch_shape[:2], -1)
          * model.llik_scaling
      )
      lqz_x = qz_x.log_prob(zs).sum(-1)
      return log_mean_exp(lpz + lpx_z.sum(-1) - lqz_x).sum()
  
file_path: mmvae/src/report/calculate_likelihoods.py
imports: import os
  import sys
  import argparse
  import numpy
  import torch
  from torchvision.utils import save_image
  import inspect
  import models
  from utils import Logger, Timer, unpack_data, log_mean_exp
label_desc: Use image node_id 2 for calling a global function with example usage: iwae(qz_x, px_z, zs, x) and returns: log_mean_exp