code: def m_iwae(qz_xs, px_zs, zss, x):
      """IWAE estimate for log p_\theta(x) for multi-modal vae -- fully vectorised"""
      lws = []
      for r, qz_x in enumerate(qz_xs):
          lpz = model.pz(*model.pz_params).log_prob(zss[r]).sum(-1)
          lqz_x = log_mean_exp(
              torch.stack(
                  [qz_x.log_prob(zss[r]).sum(-1) for qz_x in qz_xs]
              )
          )
          lpx_z = [
              px_z.log_prob(x[d])
              .view(*px_z.batch_shape[:2], -1)
              .mul(model.vaes[d].llik_scaling)
              .sum(-1)
              for d, px_z in enumerate(px_zs[r])
          ]
          lpx_z = torch.stack(lpx_z).sum(0)
          lw = lpz + lpx_z - lqz_x
          lws.append(lw)
      return log_mean_exp(torch.cat(lws)).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 1 for calling a global function with example usage: m_iwae(qz_xs, px_zs, zss, x) and returns: log_mean_exp