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.components
totalInstances
Constructor and Description |
---|
SingleShotDetectionLoss()
Base class for metric with abstract update methods.
|
Modifier and Type | Method and Description |
---|---|
protected ai.djl.util.Pair<NDList,NDList> |
inputForComponent(int componentIndex,
NDList labels,
NDList predictions)
Calculate loss between label and prediction.
|
addAccumulator, evaluate, getAccumulator, getComponents, resetAccumulator, updateAccumulator
elasticNetWeightedDecay, elasticNetWeightedDecay, elasticNetWeightedDecay, elasticNetWeightedDecay, hingeLoss, hingeLoss, hingeLoss, l1Loss, l1Loss, l1Loss, l1WeightedDecay, l1WeightedDecay, l1WeightedDecay, l2Loss, l2Loss, l2Loss, l2WeightedDecay, l2WeightedDecay, l2WeightedDecay, maskedSoftmaxCrossEntropyLoss, maskedSoftmaxCrossEntropyLoss, maskedSoftmaxCrossEntropyLoss, sigmoidBinaryCrossEntropyLoss, sigmoidBinaryCrossEntropyLoss, sigmoidBinaryCrossEntropyLoss, softmaxCrossEntropyLoss, softmaxCrossEntropyLoss, softmaxCrossEntropyLoss
checkLabelShapes, checkLabelShapes, getName
public SingleShotDetectionLoss()
protected ai.djl.util.Pair<NDList,NDList> inputForComponent(int componentIndex, NDList labels, NDList predictions)
inputForComponent
in class AbstractCompositeLoss
labels
- target labels. Must contain (offsetLabels, masks, classlabels). This is
returned by MultiBoxTarget functionpredictions
- predicted labels (class prediction, offset prediction)componentIndex
- the index of the component loss