class_docstr: DRÆM: A discriminatively trained reconstruction embedding for surface anomaly detection.
  
  Args:
      hparams (DictConfig | ListConfig): Model parameters
class_docstr_tok: ["DR\u00c6M",":","A","discriminatively","trained","reconstruction","embedding","for","surface","anomaly","detection",".","Args",":","hparams","(","DictConfig","|","ListConfig",")",":","Model","parameters"]
code: def __init__(self, hparams: DictConfig | ListConfig) -> None:
      # beta in config can be either float or sequence
      beta = hparams.model.beta
      # if sequence - change to tuple[float, float]
      if isinstance(beta, ListConfig):
          beta = tuple(beta)
  
      super().__init__(
          enable_sspcab=hparams.model.enable_sspcab,
          sspcab_lambda=hparams.model.sspcab_lambda,
          anomaly_source_path=hparams.model.anomaly_source_path,
          beta=beta,
      )
      self.hparams: DictConfig | ListConfig  # type: ignore
      self.save_hyperparameters(hparams)
  
imports: from __future__ import annotations
  from typing import Callable
  import torch
  from omegaconf import DictConfig, ListConfig
  from pytorch_lightning.callbacks import EarlyStopping
  from pytorch_lightning.utilities.types import STEP_OUTPUT
  from torch import Tensor, nn
  from anomalib.data.utils import Augmenter
  from anomalib.models.components import AnomalyModule
  from anomalib.models.draem.loss import DraemLoss
  from anomalib.models.draem.torch_model import DraemModel
label_desc: Use image node_id 1 to create a new DraemLightning object from inherited base classes: Draem with example: obj = DraemLightning(hparams)