class_docstr: The DAGMM module used in the DAGMM detector.
  
  :meta private:
code: def loss_func(
      self, x, recon_x, z, gamma, lambda_energy, lambda_cov_diag
  ):
      recon_error = torch.mean((x.view(*recon_x.shape) - recon_x) ** 2)
      phi, mu, cov = self.compute_gmms(z, gamma)
      sample_energy, cov_diag = self.compute_energy(z, phi, mu, cov)
      loss = (
          recon_error
          + lambda_energy * sample_energy
          + lambda_cov_diag * cov_diag
      )
      return loss, sample_energy, recon_error, cov_diag
  
imports: import copy
  import random
  from typing import List
  import numpy
  import pandas
  from merlion.utils import TimeSeries
  from merlion.models.base import NormalizingConfig
  from merlion.models.anomaly.base import DetectorBase, DetectorConfig, MultipleTimeseriesDetectorMixin
  from merlion.post_process.threshold import AggregateAlarms
  from merlion.utils.misc import ProgressBar, initializer
  from merlion.models.utils.rolling_window_dataset import RollingWindowDataset
label_desc: Use image node_id 6 for calling the DAGMMModule obj's underlying member method code with example usage: obj.loss_func(x, recon_x, z, gamma, lambda_energy, lambda_cov_diag) and returns: loss,  sample_energy,  recon_error,  cov_diag