Package ai.djl.training.evaluator
Class BoundingBoxError
java.lang.Object
ai.djl.training.evaluator.Evaluator
ai.djl.training.evaluator.BoundingBoxError
BoundingBoxError
is an Evaluator
that computes the error in the prediction of
bounding boxes in SingleShotDetection model.-
Field Summary
Fields inherited from class ai.djl.training.evaluator.Evaluator
totalInstances
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAccumulator
(String key) Adds an accumulator for the results of the evaluation with the given key.Calculates the evaluation between the labels and the predictions.float
getAccumulator
(String key) Returns the accumulated evaluator value.void
resetAccumulator
(String key) Resets the evaluator value with the given key.void
updateAccumulator
(String key, NDList labels, NDList predictions) Updates the evaluator with the given key based on aNDList
of labels and predictions.void
updateAccumulators
(String[] keys, NDList labels, NDList predictions) Updates the evaluator with the given keys based on aNDList
of labels and predictions.Methods inherited from class ai.djl.training.evaluator.Evaluator
checkLabelShapes, checkLabelShapes, getName
-
Constructor Details
-
BoundingBoxError
Creates an BoundingBoxError evaluator.- Parameters:
name
- the name of the evaluator
-
-
Method Details
-
evaluate
Calculates the evaluation between the labels and the predictions. -
addAccumulator
Adds an accumulator for the results of the evaluation with the given key.- Specified by:
addAccumulator
in classEvaluator
- Parameters:
key
- the key for the new accumulator
-
updateAccumulator
Updates the evaluator with the given key based on aNDList
of labels and predictions.This is a synchronized operation. You should only call it at the end of a batch or epoch.
- Specified by:
updateAccumulator
in classEvaluator
- Parameters:
key
- the key of the accumulator to updatelabels
- aNDList
of labelspredictions
- aNDList
of predictions
-
updateAccumulators
Updates the evaluator with the given keys based on aNDList
of labels and predictions.This is a synchronized operation. You should only call it at the end of a batch or epoch.
This is an alternative to @{link
Evaluator.updateAccumulator(String, NDList, NDList)
} that may be more efficient when updating multiple accumulators at once.- Overrides:
updateAccumulators
in classEvaluator
- Parameters:
keys
- the keys of all the accumulators to updatelabels
- aNDList
of labelspredictions
- aNDList
of predictions
-
resetAccumulator
Resets the evaluator value with the given key.- Specified by:
resetAccumulator
in classEvaluator
- Parameters:
key
- the key of the accumulator to reset
-
getAccumulator
Returns the accumulated evaluator value.- Specified by:
getAccumulator
in classEvaluator
- Parameters:
key
- the key of the accumulator to get- Returns:
- the accumulated value
-