-
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
call
is deprecated from v1.0.0 and will be removed from v1.1.0, override theforward
method instead."
- Properties
- result: The
torch.Tensor
of average metric results
- result: The
- Methods
- Constructor
- Parameters:
- metric_fn: An optional
Callable
metrics function that acceptsAny
kind of prediction input and target and returns a metrictorch.Tensor
. Acall
method must be overriden if this parameter is set asNone
. - target: A
str
of target name ininput
andtarget
during direct calling
- metric_fn: An optional
- Parameters:
-
forward
- Forward the current result method
- Parameters:
- input: The prediction, or
y_pred
, inAny
kind - target: The label, or
y_true
, inAny
kind
- 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
int
of the probability dim index for the input - Constructor
- Parameters:
- dim: An
int
of the classification dimension - target: Astr
of target name ininput
andtarget
during 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
int
of the total number of classes - target: Astr
of target name ininput
andtarget
during direct calling
- Methods to implement:
- forward_metric: The main method that accepts TP, TN, FP, and FN as
torch.Tensor
and 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
Module
to 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
bool
flag of if usescipy.linalg
package
The iIoU metric for segmentation
- extends:
ConfusionMetrics
The Mean Absolute Error metric
- extends:
Metric
- Properties:
- reduction: A
.loss.Reduction
of reduction method
The mIoU metric for segmentation
- extends:
Metric
- The old
MIoU
metric in v1.0.3 calculates iIoU and has been renamed toInstanceIoU
- Constructor
- Parameters:
- dim: An
int
of class dimension - smooth: Afloat
of smooth value to avoid zero devision
The partial dice score for a specific class index
- extends
Dice
- Properties:
- class_idx: An
int
of 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
int
of the window size
The metric wrapping function that wrap a function into a metric
- Use as a decorator