code: def log_likelihood(self, x, x_dims=(128, 128), standard=False):
          
          mu, std, h, w = self.params
          shape = tf.stack([32, x_dims[0], x_dims[1], self.num_latent, 1, 1])
          x_reshape = tf.reshape(x, shape)
          c = - 0.5 * math.log(2 * math.pi)
          if standard is False:
              density = c - tf.log(std + 1e-10) - (x_reshape - mu) ** 2 / (2 * std**2)
          else:
              density = c - x_reshape ** 2 / 2
          # sum over all importance weights. average over all eq_samples
          return tf.reduce_mean(tf.reduce_sum(density, axis=2), axis=(1, 2))
docs: Calculate Log Likelihood with particular mean and std
          x must be 2D. [batch_size * eqsamples* iwsamples, num_latent]