-
Notifications
You must be signed in to change notification settings - Fork 0
Metrics Documentation
The basic metric class
- extends:
torch.nn.Module - Could be use as a decorator of a function
- Metric tensor is released from memory as soon as the result returned
- [Deprecation Warning]: Method
callis deprecated from v1.0.0 and will be removed from v1.1.0, override theforwardmethod instead."
- Properties
- result: The
torch.Tensorof average metric results
- result: The
- Methods
- Constructor
- Parameters:
- metric_fn: An optional
Callablemetrics function that acceptsAnykind of prediction input and target and returns a metrictorch.Tensor. Acallmethod must be overriden if this parameter is set asNone. - target: A
strof target name ininputandtargetduring direct calling
- metric_fn: An optional
- Parameters:
-
forward- Forward the current result method
- Parameters:
- input: The prediction, or
y_pred, inAnykind - target: The label, or
y_true, inAnykind
- input: The prediction, or
- Returns: The metric in
torch.Tensor
-
reset- Reset the current results list
- Constructor
The traditional accuracy metric to compare two torch.Tensor
- extends:
Metric
The accuracy metric for normal integer labels
- extends:
Accuracy - Properties:
- dim: An
intof the probability dim index for the input - Constructor
- Parameters:
- dim: An
intof the classification dimension - target: Astrof target name ininputandtargetduring direct calling
The accuracy metric for categorical labels
- extends:
SparseCategoricalAccuracy
The binary confusion metrics that calculates TP, FP, and FN and forward further to calculate the final metric
- extends:
.metric.Metric - Abstract class
The metric that calculates confusion metrics
- extends:
Metric - Constructor
- Parameters:
- num_classes: An
intof the total number of classes - target: Astrof target name ininputandtargetduring direct calling
- Methods to implement:
- forward_metric: The main method that accepts TP, TN, FP, and FN as
torch.Tensorand returns the final metric astorch.Tensor
The dice score metrics
- extends:
BinaryConfusionMetric
The f1 score metrics
- extends:
BinaryConfusionMetric
A metric that extracts inputs and targets with feature extractor and evaluates the extracted features instead of raw inputs
- Extends:
.metric.Metric - Generic class of
Module
- Parameters:
- feature_extractor: A
Moduleto extract the features
A general feature score metric which can be used as InceptionScore by taking the feature_extractor as an InceptionV3 model
- Extends:
FeatureExtractorMetric - Generic class of
Module
Fréchet Inception Distance (FID) metric
- Extends:
FeatureExtractorMetric - Generic class of
Module
- Properties:
- use_linalg: A
boolflag of if usescipy.linalgpackage
The iIoU metric for segmentation
- extends:
ConfusionMetrics
The Mean Absolute Error metric
- extends:
Metric
- Properties:
- reduction: A
.loss.Reductionof reduction method
The mIoU metric for segmentation
- extends:
Metric - The old
MIoUmetric in v1.0.3 calculates iIoU and has been renamed toInstanceIoU - Constructor
- Parameters:
- dim: An
intof class dimension - smooth: Afloatof smooth value to avoid zero devision
The partial dice score for a specific class index
- extends
Dice
- Properties:
- class_idx: An
intof the target class index
The precision score metric
- extends:
BinaryConfusionMetric
The recall score metric
- extends:
BinaryConfusionMetric
The Structural Similarity Index metric
- extends:
Metrics
- Properties:
- window: A random gaussian window
- window_size: An
intof the window size
The metric wrapping function that wrap a function into a metric
- Use as a decorator
The loss wrapping function that wrap a function with target and weight given into a loss
- Use as a decorator