:py:mod:`anomalib.models.draem.loss` ==================================== .. py:module:: anomalib.models.draem.loss .. autoapi-nested-parse:: Loss function for the DRAEM model implementation. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: anomalib.models.draem.loss.DraemLoss .. py:class:: DraemLoss Bases: :py:obj:`torch.nn.Module` Overall loss function of the DRAEM model. The total loss consists of the sum of the L2 loss and Focal loss between the reconstructed image and the input image, and the Structural Similarity loss between the predicted and GT anomaly masks. .. py:method:: forward(input_image, reconstruction, anomaly_mask, prediction) Compute the loss over a batch for the DRAEM model.