Class SingleShotDetectionLoss


  • public class SingleShotDetectionLoss
    extends AbstractCompositeLoss
    SingleShotDetectionLoss is an implementation of Loss. It is used to compute the loss while training a Single Shot Detection (SSD) model for object detection. It involves computing the targets given the generated anchors, labels and predictions, and then computing the sum of class predictions and bounding box predictions.
    • Constructor Detail

      • SingleShotDetectionLoss

        public SingleShotDetectionLoss()
        Base class for metric with abstract update methods.
    • Method Detail

      • inputForComponent

        protected ai.djl.util.Pair<NDList,​NDList> inputForComponent​(int componentIndex,
                                                                          NDList labels,
                                                                          NDList predictions)
        Calculate loss between label and prediction.
        Specified by:
        inputForComponent in class AbstractCompositeLoss
        Parameters:
        labels - target labels. Must contain (offsetLabels, masks, classlabels). This is returned by MultiBoxTarget function
        predictions - predicted labels (class prediction, offset prediction)
        componentIndex - the index of the component loss
        Returns:
        loss value