diff --git a/src/torchmetrics/audio/pesq.py b/src/torchmetrics/audio/pesq.py index 67f1f69107b..2ddbb88a15e 100644 --- a/src/torchmetrics/audio/pesq.py +++ b/src/torchmetrics/audio/pesq.py @@ -85,8 +85,8 @@ class PerceptualEvaluationSpeechQuality(Metric): full_state_update: bool = False is_differentiable: bool = False higher_is_better: bool = True - plot_lower_bound = 1.0 - plot_upper_bound = 4.5 + plot_lower_bound: float = 1.0 + plot_upper_bound: float = 4.5 def __init__( self, diff --git a/src/torchmetrics/audio/pit.py b/src/torchmetrics/audio/pit.py index 779fb4115ff..97968ea8d2d 100644 --- a/src/torchmetrics/audio/pit.py +++ b/src/torchmetrics/audio/pit.py @@ -69,8 +69,8 @@ class PermutationInvariantTraining(Metric): is_differentiable: bool = True sum_pit_metric: Tensor total: Tensor - plot_lower_bound = -10.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = -10.0 + plot_upper_bound: float = 1.0 def __init__( self, diff --git a/src/torchmetrics/audio/sdr.py b/src/torchmetrics/audio/sdr.py index bc773476ca8..af0280d2532 100644 --- a/src/torchmetrics/audio/sdr.py +++ b/src/torchmetrics/audio/sdr.py @@ -85,8 +85,8 @@ class SignalDistortionRatio(Metric): full_state_update: bool = False is_differentiable: bool = True higher_is_better: bool = True - plot_lower_bound = -20.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = -20.0 + plot_upper_bound: float = 1.0 def __init__( self, @@ -195,8 +195,8 @@ class ScaleInvariantSignalDistortionRatio(Metric): higher_is_better = True sum_si_sdr: Tensor total: Tensor - plot_lower_bound = -40.0 - plot_upper_bound = 20.0 + plot_lower_bound: float = -40.0 + plot_upper_bound: float = 20.0 def __init__( self, diff --git a/src/torchmetrics/audio/snr.py b/src/torchmetrics/audio/snr.py index 1c52f98cbca..9fb21296c4d 100644 --- a/src/torchmetrics/audio/snr.py +++ b/src/torchmetrics/audio/snr.py @@ -64,8 +64,8 @@ class SignalNoiseRatio(Metric): higher_is_better: bool = True sum_snr: Tensor total: Tensor - plot_lower_bound = -20.0 - plot_upper_bound = 5.0 + plot_lower_bound: float = -20.0 + plot_upper_bound: float = 5.0 def __init__( self, @@ -164,8 +164,8 @@ class ScaleInvariantSignalNoiseRatio(Metric): sum_si_snr: Tensor total: Tensor higher_is_better = True - plot_lower_bound = -20.0 - plot_upper_bound = 10.0 + plot_lower_bound: float = -20.0 + plot_upper_bound: float = 10.0 def __init__( self, diff --git a/src/torchmetrics/audio/stoi.py b/src/torchmetrics/audio/stoi.py index 4381b095f3a..d3863e6c7ba 100644 --- a/src/torchmetrics/audio/stoi.py +++ b/src/torchmetrics/audio/stoi.py @@ -77,8 +77,8 @@ class ShortTimeObjectiveIntelligibility(Metric): full_state_update: bool = False is_differentiable: bool = False higher_is_better: bool = True - plot_lower_bound = -20.0 - plot_upper_bound = 5.0 + plot_lower_bound: float = -20.0 + plot_upper_bound: float = 5.0 def __init__( self, diff --git a/src/torchmetrics/classification/accuracy.py b/src/torchmetrics/classification/accuracy.py index 6532ebfd75f..220b687d777 100644 --- a/src/torchmetrics/classification/accuracy.py +++ b/src/torchmetrics/classification/accuracy.py @@ -91,8 +91,8 @@ class BinaryAccuracy(BinaryStatScores): is_differentiable = False higher_is_better = True full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def compute(self) -> Tensor: """Compute accuracy based on inputs passed in to ``update`` previously.""" @@ -237,9 +237,9 @@ class MulticlassAccuracy(MulticlassStatScores): is_differentiable = False higher_is_better = True full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 - plot_legend_name = "Class" + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Class" def compute(self) -> Tensor: """Compute accuracy based on inputs passed in to ``update`` previously.""" @@ -384,9 +384,9 @@ class MultilabelAccuracy(MultilabelStatScores): is_differentiable = False higher_is_better = True full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 - plot_legend_name = "Label" + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Label" def compute(self) -> Tensor: """Compute accuracy based on inputs passed in to ``update`` previously.""" diff --git a/src/torchmetrics/classification/auroc.py b/src/torchmetrics/classification/auroc.py index 8fbd1663cc1..bdbe259aad6 100644 --- a/src/torchmetrics/classification/auroc.py +++ b/src/torchmetrics/classification/auroc.py @@ -99,8 +99,8 @@ class BinaryAUROC(BinaryPrecisionRecallCurve): is_differentiable: bool = False higher_is_better: Optional[bool] = None full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, @@ -239,9 +239,9 @@ class MulticlassAUROC(MulticlassPrecisionRecallCurve): is_differentiable: bool = False higher_is_better: Optional[bool] = None full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 - plot_legend_name = "Class" + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Class" def __init__( self, @@ -386,9 +386,9 @@ class MultilabelAUROC(MultilabelPrecisionRecallCurve): is_differentiable: bool = False higher_is_better: Optional[bool] = None full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 - plot_legend_name = "Label" + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Label" def __init__( self, diff --git a/src/torchmetrics/classification/average_precision.py b/src/torchmetrics/classification/average_precision.py index 432c78519dd..304f1dd8d9e 100644 --- a/src/torchmetrics/classification/average_precision.py +++ b/src/torchmetrics/classification/average_precision.py @@ -106,8 +106,8 @@ class BinaryAveragePrecision(BinaryPrecisionRecallCurve): is_differentiable: bool = False higher_is_better: Optional[bool] = None full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def compute(self) -> Tensor: """Compute metric.""" @@ -238,9 +238,9 @@ class MulticlassAveragePrecision(MulticlassPrecisionRecallCurve): is_differentiable: bool = False higher_is_better: Optional[bool] = None full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 - plot_legend_name = "Class" + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Class" def __init__( self, @@ -390,9 +390,9 @@ class MultilabelAveragePrecision(MultilabelPrecisionRecallCurve): is_differentiable: bool = False higher_is_better: Optional[bool] = None full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 - plot_legend_name = "Label" + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Label" def __init__( self, diff --git a/src/torchmetrics/classification/calibration_error.py b/src/torchmetrics/classification/calibration_error.py index a8c3ea5ca05..ccf53b0f827 100644 --- a/src/torchmetrics/classification/calibration_error.py +++ b/src/torchmetrics/classification/calibration_error.py @@ -99,8 +99,8 @@ class BinaryCalibrationError(Metric): is_differentiable: bool = False higher_is_better: bool = False full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, @@ -245,8 +245,9 @@ class MulticlassCalibrationError(Metric): is_differentiable: bool = False higher_is_better: bool = False full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Class" def __init__( self, diff --git a/src/torchmetrics/classification/cohen_kappa.py b/src/torchmetrics/classification/cohen_kappa.py index 40e8e482ec1..93a4e40435b 100644 --- a/src/torchmetrics/classification/cohen_kappa.py +++ b/src/torchmetrics/classification/cohen_kappa.py @@ -90,8 +90,8 @@ class labels. is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, @@ -215,8 +215,9 @@ class labels. is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Class" def __init__( self, diff --git a/src/torchmetrics/classification/dice.py b/src/torchmetrics/classification/dice.py index fc98037076d..bd9c42219cb 100644 --- a/src/torchmetrics/classification/dice.py +++ b/src/torchmetrics/classification/dice.py @@ -136,6 +136,9 @@ class Dice(Metric): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Class" @no_type_check def __init__( diff --git a/src/torchmetrics/classification/exact_match.py b/src/torchmetrics/classification/exact_match.py index 8ddcacbee37..b849625ec5d 100644 --- a/src/torchmetrics/classification/exact_match.py +++ b/src/torchmetrics/classification/exact_match.py @@ -95,6 +95,9 @@ class MulticlassExactMatch(Metric): is_differentiable = False higher_is_better = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Class" def __init__( self, @@ -253,6 +256,9 @@ class MultilabelExactMatch(Metric): is_differentiable = False higher_is_better = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Label" def __init__( self, diff --git a/src/torchmetrics/classification/f_beta.py b/src/torchmetrics/classification/f_beta.py index 6760809e544..0272f3971bc 100644 --- a/src/torchmetrics/classification/f_beta.py +++ b/src/torchmetrics/classification/f_beta.py @@ -109,6 +109,8 @@ class BinaryFBetaScore(BinaryStatScores): is_differentiable: bool = False higher_is_better: Optional[bool] = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, @@ -280,6 +282,9 @@ class MulticlassFBetaScore(MulticlassStatScores): is_differentiable: bool = False higher_is_better: Optional[bool] = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Class" def __init__( self, @@ -451,6 +456,9 @@ class MultilabelFBetaScore(MultilabelStatScores): is_differentiable: bool = False higher_is_better: Optional[bool] = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Label" def __init__( self, @@ -592,6 +600,8 @@ class BinaryF1Score(BinaryFBetaScore): is_differentiable: bool = False higher_is_better: Optional[bool] = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, @@ -752,6 +762,9 @@ class MulticlassF1Score(MulticlassFBetaScore): is_differentiable: bool = False higher_is_better: Optional[bool] = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Class" def __init__( self, @@ -912,6 +925,9 @@ class MultilabelF1Score(MultilabelFBetaScore): is_differentiable: bool = False higher_is_better: Optional[bool] = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Label" def __init__( self, diff --git a/src/torchmetrics/classification/group_fairness.py b/src/torchmetrics/classification/group_fairness.py index 360429400df..4cee8d0029a 100644 --- a/src/torchmetrics/classification/group_fairness.py +++ b/src/torchmetrics/classification/group_fairness.py @@ -98,6 +98,8 @@ class BinaryGroupStatRates(_AbstractGroupStatScores): is_differentiable = False higher_is_better = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, @@ -200,6 +202,8 @@ class BinaryFairness(_AbstractGroupStatScores): is_differentiable = False higher_is_better = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, diff --git a/src/torchmetrics/classification/hamming.py b/src/torchmetrics/classification/hamming.py index c426d94285c..06bde90523b 100644 --- a/src/torchmetrics/classification/hamming.py +++ b/src/torchmetrics/classification/hamming.py @@ -101,6 +101,8 @@ class BinaryHammingDistance(BinaryStatScores): is_differentiable: bool = False higher_is_better: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def compute(self) -> Tensor: """Compute metric.""" @@ -248,6 +250,9 @@ class MulticlassHammingDistance(MulticlassStatScores): is_differentiable: bool = False higher_is_better: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Class" def compute(self) -> Tensor: """Compute metric.""" @@ -393,6 +398,9 @@ class MultilabelHammingDistance(MultilabelStatScores): is_differentiable: bool = False higher_is_better: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Label" def compute(self) -> Tensor: """Compute metric.""" diff --git a/src/torchmetrics/classification/hinge.py b/src/torchmetrics/classification/hinge.py index d15eec8a8bd..657e562daea 100644 --- a/src/torchmetrics/classification/hinge.py +++ b/src/torchmetrics/classification/hinge.py @@ -84,6 +84,8 @@ class BinaryHingeLoss(Metric): is_differentiable: bool = True higher_is_better: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, @@ -219,6 +221,9 @@ class MulticlassHingeLoss(Metric): is_differentiable: bool = True higher_is_better: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Class" def __init__( self, diff --git a/src/torchmetrics/classification/jaccard.py b/src/torchmetrics/classification/jaccard.py index b4e08d65f24..219973736cb 100644 --- a/src/torchmetrics/classification/jaccard.py +++ b/src/torchmetrics/classification/jaccard.py @@ -82,6 +82,8 @@ class BinaryJaccardIndex(BinaryConfusionMatrix): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, @@ -199,10 +201,12 @@ class MulticlassJaccardIndex(MulticlassConfusionMatrix): >>> metric(preds, target) tensor(0.6667) """ - is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Class" def __init__( self, @@ -327,6 +331,9 @@ class MultilabelJaccardIndex(MultilabelConfusionMatrix): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Label" def __init__( self, diff --git a/src/torchmetrics/classification/matthews_corrcoef.py b/src/torchmetrics/classification/matthews_corrcoef.py index e0355dda099..72c55c5ccf5 100644 --- a/src/torchmetrics/classification/matthews_corrcoef.py +++ b/src/torchmetrics/classification/matthews_corrcoef.py @@ -79,6 +79,8 @@ class BinaryMatthewsCorrCoef(BinaryConfusionMatrix): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, @@ -186,6 +188,9 @@ class MulticlassMatthewsCorrCoef(MulticlassConfusionMatrix): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Class" def __init__( self, @@ -291,6 +296,9 @@ class MultilabelMatthewsCorrCoef(MultilabelConfusionMatrix): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Label" def __init__( self, diff --git a/src/torchmetrics/classification/precision_recall.py b/src/torchmetrics/classification/precision_recall.py index b72e7a78d19..6462231d4ee 100644 --- a/src/torchmetrics/classification/precision_recall.py +++ b/src/torchmetrics/classification/precision_recall.py @@ -99,6 +99,8 @@ class BinaryPrecision(BinaryStatScores): is_differentiable: bool = False higher_is_better: Optional[bool] = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def compute(self) -> Tensor: """Compute metric.""" @@ -247,6 +249,9 @@ class MulticlassPrecision(MulticlassStatScores): is_differentiable: bool = False higher_is_better: Optional[bool] = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Class" def compute(self) -> Tensor: """Compute metric.""" @@ -392,6 +397,9 @@ class MultilabelPrecision(MultilabelStatScores): is_differentiable: bool = False higher_is_better: Optional[bool] = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Label" def compute(self) -> Tensor: """Compute metric.""" @@ -507,6 +515,8 @@ class BinaryRecall(BinaryStatScores): is_differentiable: bool = False higher_is_better: Optional[bool] = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def compute(self) -> Tensor: """Compute metric.""" @@ -654,6 +664,9 @@ class MulticlassRecall(MulticlassStatScores): is_differentiable: bool = False higher_is_better: Optional[bool] = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Class" def compute(self) -> Tensor: """Compute metric.""" @@ -798,6 +811,9 @@ class MultilabelRecall(MultilabelStatScores): is_differentiable: bool = False higher_is_better: Optional[bool] = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Label" def compute(self) -> Tensor: """Compute metric.""" diff --git a/src/torchmetrics/classification/ranking.py b/src/torchmetrics/classification/ranking.py index 7724d983d72..9ea95f39a62 100644 --- a/src/torchmetrics/classification/ranking.py +++ b/src/torchmetrics/classification/ranking.py @@ -78,6 +78,9 @@ class MultilabelCoverageError(Metric): higher_is_better: bool = False is_differentiable: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Label" def __init__( self, @@ -193,6 +196,9 @@ class MultilabelRankingAveragePrecision(Metric): higher_is_better: bool = True is_differentiable: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Label" def __init__( self, @@ -310,6 +316,9 @@ class MultilabelRankingLoss(Metric): higher_is_better: bool = False is_differentiable: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Label" def __init__( self, diff --git a/src/torchmetrics/classification/recall_at_fixed_precision.py b/src/torchmetrics/classification/recall_at_fixed_precision.py index 7f7503aff22..8e39375e179 100644 --- a/src/torchmetrics/classification/recall_at_fixed_precision.py +++ b/src/torchmetrics/classification/recall_at_fixed_precision.py @@ -105,6 +105,8 @@ class BinaryRecallAtFixedPrecision(BinaryPrecisionRecallCurve): is_differentiable: bool = False higher_is_better: Optional[bool] = None full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, @@ -237,6 +239,9 @@ class MulticlassRecallAtFixedPrecision(MulticlassPrecisionRecallCurve): is_differentiable: bool = False higher_is_better: Optional[bool] = None full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Class" def __init__( self, @@ -377,6 +382,9 @@ class MultilabelRecallAtFixedPrecision(MultilabelPrecisionRecallCurve): is_differentiable: bool = False higher_is_better: Optional[bool] = None full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Label" def __init__( self, diff --git a/src/torchmetrics/classification/roc.py b/src/torchmetrics/classification/roc.py index b856769c4fd..d1ad3c65f58 100644 --- a/src/torchmetrics/classification/roc.py +++ b/src/torchmetrics/classification/roc.py @@ -109,6 +109,8 @@ class BinaryROC(BinaryPrecisionRecallCurve): is_differentiable: bool = False higher_is_better: Optional[bool] = None full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def compute(self) -> Tuple[Tensor, Tensor, Tensor]: """Compute metric.""" @@ -256,6 +258,9 @@ class MulticlassROC(MulticlassPrecisionRecallCurve): is_differentiable: bool = False higher_is_better: Optional[bool] = None full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Class" def compute(self) -> Union[Tuple[Tensor, Tensor, Tensor], Tuple[List[Tensor], List[Tensor], List[Tensor]]]: """Compute metric.""" @@ -405,6 +410,9 @@ class MultilabelROC(MultilabelPrecisionRecallCurve): is_differentiable: bool = False higher_is_better: Optional[bool] = None full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Label" def compute(self) -> Union[Tuple[Tensor, Tensor, Tensor], Tuple[List[Tensor], List[Tensor], List[Tensor]]]: """Compute metric.""" diff --git a/src/torchmetrics/classification/specificity.py b/src/torchmetrics/classification/specificity.py index ab61cee7d17..d455897635d 100644 --- a/src/torchmetrics/classification/specificity.py +++ b/src/torchmetrics/classification/specificity.py @@ -89,6 +89,8 @@ class BinarySpecificity(BinaryStatScores): >>> metric(preds, target) tensor([0.0000, 0.3333]) """ + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def compute(self) -> Tensor: """Compute metric.""" @@ -232,6 +234,9 @@ class MulticlassSpecificity(MulticlassStatScores): tensor([[0.7500, 0.7500, 0.7500], [0.8000, 0.6667, 0.5000]]) """ + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Class" def compute(self) -> Tensor: """Compute metric.""" @@ -371,6 +376,9 @@ class MultilabelSpecificity(MultilabelStatScores): tensor([[0., 0., 0.], [0., 0., 1.]]) """ + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Label" def compute(self) -> Tensor: """Compute metric.""" diff --git a/src/torchmetrics/classification/specificity_at_sensitivity.py b/src/torchmetrics/classification/specificity_at_sensitivity.py index 8894cb146d8..b8e1ea5e2e7 100644 --- a/src/torchmetrics/classification/specificity_at_sensitivity.py +++ b/src/torchmetrics/classification/specificity_at_sensitivity.py @@ -103,6 +103,8 @@ class BinarySpecificityAtSensitivity(BinaryPrecisionRecallCurve): is_differentiable: bool = False higher_is_better: Optional[bool] = None full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, @@ -190,6 +192,9 @@ class MulticlassSpecificityAtSensitivity(MulticlassPrecisionRecallCurve): is_differentiable: bool = False higher_is_better: Optional[bool] = None full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Class" def __init__( self, @@ -286,6 +291,9 @@ class MultilabelSpecificityAtSensitivity(MultilabelPrecisionRecallCurve): is_differentiable: bool = False higher_is_better: Optional[bool] = None full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + plot_legend_name: str = "Label" def __init__( self, diff --git a/src/torchmetrics/detection/mean_ap.py b/src/torchmetrics/detection/mean_ap.py index 732342d6b69..cd7f3113a59 100644 --- a/src/torchmetrics/detection/mean_ap.py +++ b/src/torchmetrics/detection/mean_ap.py @@ -352,6 +352,8 @@ class MeanAveragePrecision(Metric): is_differentiable: bool = False higher_is_better: Optional[bool] = None full_state_update: bool = True + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 detections: List[Tensor] detection_scores: List[Tensor] diff --git a/src/torchmetrics/detection/modified_panoptic_quality.py b/src/torchmetrics/detection/modified_panoptic_quality.py index aa3d0b0fb5f..5f7c5655cca 100644 --- a/src/torchmetrics/detection/modified_panoptic_quality.py +++ b/src/torchmetrics/detection/modified_panoptic_quality.py @@ -77,6 +77,8 @@ class ModifiedPanopticQuality(Metric): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 iou_sum: Tensor true_positives: Tensor diff --git a/src/torchmetrics/detection/panoptic_quality.py b/src/torchmetrics/detection/panoptic_quality.py index 8d73c977d4b..aa2276fda91 100644 --- a/src/torchmetrics/detection/panoptic_quality.py +++ b/src/torchmetrics/detection/panoptic_quality.py @@ -84,6 +84,8 @@ class PanopticQuality(Metric): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 iou_sum: Tensor true_positives: Tensor diff --git a/src/torchmetrics/image/d_lambda.py b/src/torchmetrics/image/d_lambda.py index 3d3f897cdbe..fe0a7066501 100644 --- a/src/torchmetrics/image/d_lambda.py +++ b/src/torchmetrics/image/d_lambda.py @@ -66,8 +66,8 @@ class SpectralDistortionIndex(Metric): higher_is_better: bool = True is_differentiable: bool = True full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 preds: List[Tensor] target: List[Tensor] diff --git a/src/torchmetrics/image/ergas.py b/src/torchmetrics/image/ergas.py index bf7450de730..f79b486d10c 100644 --- a/src/torchmetrics/image/ergas.py +++ b/src/torchmetrics/image/ergas.py @@ -67,8 +67,7 @@ class ErrorRelativeGlobalDimensionlessSynthesis(Metric): higher_is_better: bool = False is_differentiable: bool = True full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = 0.0 preds: List[Tensor] target: List[Tensor] diff --git a/src/torchmetrics/image/fid.py b/src/torchmetrics/image/fid.py index 99c5579d938..1d6540ced10 100644 --- a/src/torchmetrics/image/fid.py +++ b/src/torchmetrics/image/fid.py @@ -303,6 +303,7 @@ class FrechetInceptionDistance(Metric): higher_is_better: bool = False is_differentiable: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 real_features_sum: Tensor real_features_cov_sum: Tensor diff --git a/src/torchmetrics/image/inception.py b/src/torchmetrics/image/inception.py index 8ce90fb777d..c81ab531e48 100644 --- a/src/torchmetrics/image/inception.py +++ b/src/torchmetrics/image/inception.py @@ -95,6 +95,7 @@ class InceptionScore(Metric): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 features: List diff --git a/src/torchmetrics/image/kid.py b/src/torchmetrics/image/kid.py index b7b9906185e..bb3bbdd2f64 100644 --- a/src/torchmetrics/image/kid.py +++ b/src/torchmetrics/image/kid.py @@ -158,6 +158,8 @@ class KernelInceptionDistance(Metric): higher_is_better: bool = False is_differentiable: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 real_features: List[Tensor] fake_features: List[Tensor] diff --git a/src/torchmetrics/image/lpip.py b/src/torchmetrics/image/lpip.py index 2e7133a27e5..81f7de41ebd 100644 --- a/src/torchmetrics/image/lpip.py +++ b/src/torchmetrics/image/lpip.py @@ -112,6 +112,8 @@ class LearnedPerceptualImagePatchSimilarity(Metric): is_differentiable: bool = True higher_is_better: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 real_features: List[Tensor] fake_features: List[Tensor] diff --git a/src/torchmetrics/image/psnr.py b/src/torchmetrics/image/psnr.py index d26b1b279a6..e203a934c27 100644 --- a/src/torchmetrics/image/psnr.py +++ b/src/torchmetrics/image/psnr.py @@ -77,8 +77,7 @@ class PeakSignalNoiseRatio(Metric): is_differentiable: bool = True higher_is_better: bool = True full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = 0.0 min_target: Tensor max_target: Tensor diff --git a/src/torchmetrics/image/rase.py b/src/torchmetrics/image/rase.py index 7ed80c19afc..39233da0416 100644 --- a/src/torchmetrics/image/rase.py +++ b/src/torchmetrics/image/rase.py @@ -62,6 +62,7 @@ class RelativeAverageSpectralError(Metric): higher_is_better: bool = False is_differentiable: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 preds: List[Tensor] target: List[Tensor] diff --git a/src/torchmetrics/image/rmse_sw.py b/src/torchmetrics/image/rmse_sw.py index 4352ddca2e6..2db2e958b37 100644 --- a/src/torchmetrics/image/rmse_sw.py +++ b/src/torchmetrics/image/rmse_sw.py @@ -55,12 +55,14 @@ class RootMeanSquaredErrorUsingSlidingWindow(Metric): ValueError: If ``window_size`` is not a positive integer. """ - rmse_val_sum: Tensor - rmse_map: Optional[Tensor] = None - total_images: Tensor higher_is_better: bool = False is_differentiable: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + + rmse_val_sum: Tensor + rmse_map: Optional[Tensor] = None + total_images: Tensor def __init__( self, diff --git a/src/torchmetrics/image/sam.py b/src/torchmetrics/image/sam.py index e2b19388af7..6042a660244 100644 --- a/src/torchmetrics/image/sam.py +++ b/src/torchmetrics/image/sam.py @@ -68,8 +68,8 @@ class SpectralAngleMapper(Metric): higher_is_better: bool = False is_differentiable: bool = True full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 preds: List[Tensor] target: List[Tensor] diff --git a/src/torchmetrics/image/ssim.py b/src/torchmetrics/image/ssim.py index f37f32cc7fb..51cbf9c6f37 100644 --- a/src/torchmetrics/image/ssim.py +++ b/src/torchmetrics/image/ssim.py @@ -79,8 +79,8 @@ class StructuralSimilarityIndexMeasure(Metric): higher_is_better: bool = True is_differentiable: bool = True full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 preds: List[Tensor] target: List[Tensor] @@ -278,8 +278,8 @@ class MultiScaleStructuralSimilarityIndexMeasure(Metric): higher_is_better: bool = True is_differentiable: bool = True full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 preds: List[Tensor] target: List[Tensor] diff --git a/src/torchmetrics/image/tv.py b/src/torchmetrics/image/tv.py index 40b92297ba0..21b7a822ec5 100644 --- a/src/torchmetrics/image/tv.py +++ b/src/torchmetrics/image/tv.py @@ -65,6 +65,7 @@ class TotalVariation(Metric): full_state_update: bool = False is_differentiable: bool = True higher_is_better: bool = False + plot_lower_bound: float = 0.0 def __init__(self, reduction: Literal["mean", "sum", "none", None] = "sum", **kwargs: Any) -> None: super().__init__(**kwargs) diff --git a/src/torchmetrics/image/uqi.py b/src/torchmetrics/image/uqi.py index 06135bee5cd..1624ac5c651 100644 --- a/src/torchmetrics/image/uqi.py +++ b/src/torchmetrics/image/uqi.py @@ -52,7 +52,6 @@ class UniversalImageQualityIndex(Metric): data_range: Range of the image. If ``None``, it is determined from the image (max - min) kwargs: Additional keyword arguments, see :ref:`Metric kwargs` for more info. - Return: Tensor with UniversalImageQualityIndex score @@ -69,8 +68,8 @@ class UniversalImageQualityIndex(Metric): is_differentiable: bool = True higher_is_better: bool = True full_state_update: bool = False - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 preds: List[Tensor] target: List[Tensor] diff --git a/src/torchmetrics/multimodal/clip_score.py b/src/torchmetrics/multimodal/clip_score.py index 2b50c8d455f..c2681c264ee 100644 --- a/src/torchmetrics/multimodal/clip_score.py +++ b/src/torchmetrics/multimodal/clip_score.py @@ -81,6 +81,8 @@ class CLIPScore(Metric): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = True + plot_lower_bound: float = 0.0 + score: Tensor n_samples: Tensor plot_lower_bound = 0.0 diff --git a/src/torchmetrics/nominal/cramers.py b/src/torchmetrics/nominal/cramers.py index a28bc7e2b59..f91e541bc18 100644 --- a/src/torchmetrics/nominal/cramers.py +++ b/src/torchmetrics/nominal/cramers.py @@ -74,8 +74,8 @@ class CramersV(Metric): full_state_update: bool = False is_differentiable: bool = False higher_is_better: bool = True - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 confmat: Tensor def __init__( diff --git a/src/torchmetrics/nominal/pearson.py b/src/torchmetrics/nominal/pearson.py index bc3b17958a5..7f95c3cc79b 100644 --- a/src/torchmetrics/nominal/pearson.py +++ b/src/torchmetrics/nominal/pearson.py @@ -79,8 +79,8 @@ class PearsonsContingencyCoefficient(Metric): full_state_update: bool = False is_differentiable: bool = False higher_is_better: bool = True - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 confmat: Tensor def __init__( diff --git a/src/torchmetrics/nominal/theils_u.py b/src/torchmetrics/nominal/theils_u.py index 31cea7bc53b..a1b1313f2f3 100644 --- a/src/torchmetrics/nominal/theils_u.py +++ b/src/torchmetrics/nominal/theils_u.py @@ -63,8 +63,8 @@ class TheilsU(Metric): full_state_update: bool = False is_differentiable: bool = False higher_is_better: bool = True - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 confmat: Tensor def __init__( diff --git a/src/torchmetrics/nominal/tschuprows.py b/src/torchmetrics/nominal/tschuprows.py index e130a40e42a..03d13e78a1a 100644 --- a/src/torchmetrics/nominal/tschuprows.py +++ b/src/torchmetrics/nominal/tschuprows.py @@ -74,8 +74,8 @@ class TschuprowsT(Metric): full_state_update: bool = False is_differentiable: bool = False higher_is_better: bool = True - plot_lower_bound = 0.0 - plot_upper_bound = 1.0 + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 confmat: Tensor def __init__( diff --git a/src/torchmetrics/regression/concordance.py b/src/torchmetrics/regression/concordance.py index 65772889bb1..25ef4464666 100644 --- a/src/torchmetrics/regression/concordance.py +++ b/src/torchmetrics/regression/concordance.py @@ -66,6 +66,8 @@ class ConcordanceCorrCoef(PearsonCorrCoef): >>> concordance(preds, target) tensor([0.7273, 0.9887]) """ + plot_lower_bound: float = -1.0 + plot_upper_bound: float = 1.0 def compute(self) -> Tensor: """Compute final concordance correlation coefficient over metric states.""" diff --git a/src/torchmetrics/regression/cosine_similarity.py b/src/torchmetrics/regression/cosine_similarity.py index 1002708d711..43c644a1c38 100644 --- a/src/torchmetrics/regression/cosine_similarity.py +++ b/src/torchmetrics/regression/cosine_similarity.py @@ -60,6 +60,9 @@ class CosineSimilarity(Metric): is_differentiable: bool = True higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + preds: List[Tensor] target: List[Tensor] diff --git a/src/torchmetrics/regression/explained_variance.py b/src/torchmetrics/regression/explained_variance.py index f12786761e7..f38c07bce57 100644 --- a/src/torchmetrics/regression/explained_variance.py +++ b/src/torchmetrics/regression/explained_variance.py @@ -83,6 +83,9 @@ class ExplainedVariance(Metric): is_differentiable: bool = True higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + n_obs: Tensor sum_error: Tensor sum_squared_error: Tensor diff --git a/src/torchmetrics/regression/kendall.py b/src/torchmetrics/regression/kendall.py index eb01129c0e3..dc753d29a69 100644 --- a/src/torchmetrics/regression/kendall.py +++ b/src/torchmetrics/regression/kendall.py @@ -111,10 +111,12 @@ class KendallRankCorrCoef(Metric): >>> kendall(preds, target) (tensor([1., 1.]), tensor([nan, nan])) """ - is_differentiable = False higher_is_better = None full_state_update = True + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + preds: List[Tensor] target: List[Tensor] diff --git a/src/torchmetrics/regression/kl_divergence.py b/src/torchmetrics/regression/kl_divergence.py index ca94d7fa191..0a6eb74b298 100644 --- a/src/torchmetrics/regression/kl_divergence.py +++ b/src/torchmetrics/regression/kl_divergence.py @@ -79,6 +79,8 @@ class KLDivergence(Metric): is_differentiable: bool = True higher_is_better: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + total: Tensor # FIXME: Apply once minimal torch is 1.10. For torch<=1.9, jit does not support Union types # measures: Union[Tensor, List[Tensor]] diff --git a/src/torchmetrics/regression/log_cosh.py b/src/torchmetrics/regression/log_cosh.py index 3ba9eaee562..c2c0d04fde1 100644 --- a/src/torchmetrics/regression/log_cosh.py +++ b/src/torchmetrics/regression/log_cosh.py @@ -67,6 +67,8 @@ class LogCoshError(Metric): is_differentiable = True higher_is_better = False full_state_update = False + plot_lower_bound: float = 0.0 + sum_log_cosh_error: Tensor total: Tensor diff --git a/src/torchmetrics/regression/log_mse.py b/src/torchmetrics/regression/log_mse.py index a2b07aaa46c..0c3a6f2328b 100644 --- a/src/torchmetrics/regression/log_mse.py +++ b/src/torchmetrics/regression/log_mse.py @@ -58,6 +58,8 @@ class MeanSquaredLogError(Metric): is_differentiable: bool = True higher_is_better: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + sum_squared_log_error: Tensor total: Tensor diff --git a/src/torchmetrics/regression/mae.py b/src/torchmetrics/regression/mae.py index ee998908e64..9b971453314 100644 --- a/src/torchmetrics/regression/mae.py +++ b/src/torchmetrics/regression/mae.py @@ -55,6 +55,8 @@ class MeanAbsoluteError(Metric): is_differentiable: bool = True higher_is_better: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + sum_abs_error: Tensor total: Tensor diff --git a/src/torchmetrics/regression/mape.py b/src/torchmetrics/regression/mape.py index e719aaf62bd..307784fd9ec 100644 --- a/src/torchmetrics/regression/mape.py +++ b/src/torchmetrics/regression/mape.py @@ -64,6 +64,8 @@ class MeanAbsolutePercentageError(Metric): is_differentiable: bool = True higher_is_better: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + sum_abs_per_error: Tensor total: Tensor diff --git a/src/torchmetrics/regression/minkowski.py b/src/torchmetrics/regression/minkowski.py index f589018bdf2..05248010d36 100644 --- a/src/torchmetrics/regression/minkowski.py +++ b/src/torchmetrics/regression/minkowski.py @@ -55,6 +55,8 @@ class MinkowskiDistance(Metric): is_differentiable: Optional[bool] = True higher_is_better: Optional[bool] = False full_state_update: Optional[bool] = False + plot_lower_bound: float = 0.0 + minkowski_dist_sum: Tensor def __init__(self, p: float, **kwargs: Any) -> None: diff --git a/src/torchmetrics/regression/mse.py b/src/torchmetrics/regression/mse.py index 8977c6fe45e..ddf0d3b4f4b 100644 --- a/src/torchmetrics/regression/mse.py +++ b/src/torchmetrics/regression/mse.py @@ -56,7 +56,8 @@ class MeanSquaredError(Metric): is_differentiable = True higher_is_better = False full_state_update = False - plot_lower_bound = 0.0 + plot_lower_bound: float = 0.0 + sum_squared_error: Tensor total: Tensor diff --git a/src/torchmetrics/regression/pearson.py b/src/torchmetrics/regression/pearson.py index 498f8ff0307..07186824ee9 100644 --- a/src/torchmetrics/regression/pearson.py +++ b/src/torchmetrics/regression/pearson.py @@ -111,6 +111,8 @@ class PearsonCorrCoef(Metric): is_differentiable = True higher_is_better = None # both -1 and 1 are optimal full_state_update: bool = True + plot_lower_bound: float = -1.0 + plot_upper_bound: float = 1.0 preds: List[Tensor] target: List[Tensor] mean_x: Tensor diff --git a/src/torchmetrics/regression/r2.py b/src/torchmetrics/regression/r2.py index f041662d9a6..4680ab7b6e6 100644 --- a/src/torchmetrics/regression/r2.py +++ b/src/torchmetrics/regression/r2.py @@ -88,6 +88,9 @@ class R2Score(Metric): is_differentiable: bool = True higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 + sum_squared_error: Tensor sum_error: Tensor residual: Tensor diff --git a/src/torchmetrics/regression/spearman.py b/src/torchmetrics/regression/spearman.py index 2bb0263cb8e..f2a75f8b3f6 100644 --- a/src/torchmetrics/regression/spearman.py +++ b/src/torchmetrics/regression/spearman.py @@ -69,6 +69,9 @@ class SpearmanCorrCoef(Metric): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = -1.0 + plot_upper_bound: float = 1.0 + preds: List[Tensor] target: List[Tensor] diff --git a/src/torchmetrics/regression/symmetric_mape.py b/src/torchmetrics/regression/symmetric_mape.py index 6c994d0ea38..855e64f6500 100644 --- a/src/torchmetrics/regression/symmetric_mape.py +++ b/src/torchmetrics/regression/symmetric_mape.py @@ -57,6 +57,8 @@ class SymmetricMeanAbsolutePercentageError(Metric): is_differentiable: bool = True higher_is_better: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + sum_abs_per_error: Tensor total: Tensor diff --git a/src/torchmetrics/regression/tweedie_deviance.py b/src/torchmetrics/regression/tweedie_deviance.py index 53d5175c7fc..c6c70c8c340 100644 --- a/src/torchmetrics/regression/tweedie_deviance.py +++ b/src/torchmetrics/regression/tweedie_deviance.py @@ -77,6 +77,8 @@ class TweedieDevianceScore(Metric): is_differentiable: bool = True higher_is_better = None full_state_update: bool = False + plot_lower_bound: float = 0.0 + sum_deviance_score: Tensor num_observations: Tensor diff --git a/src/torchmetrics/regression/wmape.py b/src/torchmetrics/regression/wmape.py index d8a55389f13..6bfc23e7dea 100644 --- a/src/torchmetrics/regression/wmape.py +++ b/src/torchmetrics/regression/wmape.py @@ -62,6 +62,8 @@ class WeightedMeanAbsolutePercentageError(Metric): is_differentiable: bool = True higher_is_better: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + sum_abs_error: Tensor sum_scale: Tensor diff --git a/src/torchmetrics/retrieval/average_precision.py b/src/torchmetrics/retrieval/average_precision.py index 5400b4569fa..7a23bcd071e 100644 --- a/src/torchmetrics/retrieval/average_precision.py +++ b/src/torchmetrics/retrieval/average_precision.py @@ -81,6 +81,8 @@ class RetrievalMAP(RetrievalMetric): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, diff --git a/src/torchmetrics/retrieval/fall_out.py b/src/torchmetrics/retrieval/fall_out.py index b7755e755be..352c358dbee 100644 --- a/src/torchmetrics/retrieval/fall_out.py +++ b/src/torchmetrics/retrieval/fall_out.py @@ -81,6 +81,8 @@ class RetrievalFallOut(RetrievalMetric): is_differentiable: bool = False higher_is_better: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, diff --git a/src/torchmetrics/retrieval/hit_rate.py b/src/torchmetrics/retrieval/hit_rate.py index 569cccad4e5..135073df408 100644 --- a/src/torchmetrics/retrieval/hit_rate.py +++ b/src/torchmetrics/retrieval/hit_rate.py @@ -82,6 +82,8 @@ class RetrievalHitRate(RetrievalMetric): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, diff --git a/src/torchmetrics/retrieval/ndcg.py b/src/torchmetrics/retrieval/ndcg.py index 8e1a8224c13..59011d06ff7 100644 --- a/src/torchmetrics/retrieval/ndcg.py +++ b/src/torchmetrics/retrieval/ndcg.py @@ -82,6 +82,8 @@ class RetrievalNormalizedDCG(RetrievalMetric): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, diff --git a/src/torchmetrics/retrieval/precision.py b/src/torchmetrics/retrieval/precision.py index c6a877837e4..209bb118c85 100644 --- a/src/torchmetrics/retrieval/precision.py +++ b/src/torchmetrics/retrieval/precision.py @@ -84,6 +84,8 @@ class RetrievalPrecision(RetrievalMetric): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, diff --git a/src/torchmetrics/retrieval/r_precision.py b/src/torchmetrics/retrieval/r_precision.py index 59208819ba3..781e6a7b159 100644 --- a/src/torchmetrics/retrieval/r_precision.py +++ b/src/torchmetrics/retrieval/r_precision.py @@ -78,6 +78,8 @@ class RetrievalRPrecision(RetrievalMetric): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def _metric(self, preds: Tensor, target: Tensor) -> Tensor: return retrieval_r_precision(preds, target) diff --git a/src/torchmetrics/retrieval/recall.py b/src/torchmetrics/retrieval/recall.py index 92b2d7baf2b..6457b16c8b6 100644 --- a/src/torchmetrics/retrieval/recall.py +++ b/src/torchmetrics/retrieval/recall.py @@ -80,6 +80,8 @@ class RetrievalRecall(RetrievalMetric): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, diff --git a/src/torchmetrics/retrieval/reciprocal_rank.py b/src/torchmetrics/retrieval/reciprocal_rank.py index 884d49ca63a..87526bba802 100644 --- a/src/torchmetrics/retrieval/reciprocal_rank.py +++ b/src/torchmetrics/retrieval/reciprocal_rank.py @@ -77,6 +77,8 @@ class RetrievalMRR(RetrievalMetric): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def _metric(self, preds: Tensor, target: Tensor) -> Tensor: return retrieval_reciprocal_rank(preds, target) diff --git a/src/torchmetrics/text/bert.py b/src/torchmetrics/text/bert.py index 97ea38a8f8a..619a2ec47d6 100644 --- a/src/torchmetrics/text/bert.py +++ b/src/torchmetrics/text/bert.py @@ -124,6 +124,8 @@ class BERTScore(Metric): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 preds_input_ids: List[Tensor] preds_attention_mask: List[Tensor] diff --git a/src/torchmetrics/text/bleu.py b/src/torchmetrics/text/bleu.py index f98cdfcbbaa..46fe535f365 100644 --- a/src/torchmetrics/text/bleu.py +++ b/src/torchmetrics/text/bleu.py @@ -65,6 +65,8 @@ class BLEUScore(Metric): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = True + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 preds_len: Tensor target_len: Tensor diff --git a/src/torchmetrics/text/cer.py b/src/torchmetrics/text/cer.py index 4d90ad1b754..96e113a56a5 100644 --- a/src/torchmetrics/text/cer.py +++ b/src/torchmetrics/text/cer.py @@ -67,6 +67,8 @@ class CharErrorRate(Metric): is_differentiable: bool = False higher_is_better: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 errors: Tensor total: Tensor diff --git a/src/torchmetrics/text/chrf.py b/src/torchmetrics/text/chrf.py index 48061db6254..7e15a6c912b 100644 --- a/src/torchmetrics/text/chrf.py +++ b/src/torchmetrics/text/chrf.py @@ -96,6 +96,8 @@ class CHRFScore(Metric): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = True + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 sentence_chrf_score: Optional[List[Tensor]] = None diff --git a/src/torchmetrics/text/eed.py b/src/torchmetrics/text/eed.py index 56c5c27c230..335024b4c6c 100644 --- a/src/torchmetrics/text/eed.py +++ b/src/torchmetrics/text/eed.py @@ -60,6 +60,8 @@ class ExtendedEditDistance(Metric): higher_is_better: bool = False is_differentiable: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 sentence_eed: List[Tensor] diff --git a/src/torchmetrics/text/mer.py b/src/torchmetrics/text/mer.py index 1e6282b5c85..6515be9f01d 100644 --- a/src/torchmetrics/text/mer.py +++ b/src/torchmetrics/text/mer.py @@ -64,6 +64,8 @@ class MatchErrorRate(Metric): is_differentiable: bool = False higher_is_better: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 errors: Tensor total: Tensor diff --git a/src/torchmetrics/text/rouge.py b/src/torchmetrics/text/rouge.py index 99532e7588b..9763f498bc7 100644 --- a/src/torchmetrics/text/rouge.py +++ b/src/torchmetrics/text/rouge.py @@ -98,6 +98,8 @@ class ROUGEScore(Metric): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = True + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, diff --git a/src/torchmetrics/text/sacre_bleu.py b/src/torchmetrics/text/sacre_bleu.py index a7226387683..0777501f57c 100644 --- a/src/torchmetrics/text/sacre_bleu.py +++ b/src/torchmetrics/text/sacre_bleu.py @@ -87,6 +87,8 @@ class SacreBLEUScore(BLEUScore): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = True + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 def __init__( self, diff --git a/src/torchmetrics/text/squad.py b/src/torchmetrics/text/squad.py index c2aa9cf09d1..df7ac6d4491 100644 --- a/src/torchmetrics/text/squad.py +++ b/src/torchmetrics/text/squad.py @@ -92,6 +92,8 @@ class SQuAD(Metric): is_differentiable: bool = False higher_is_better: bool = True full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 100.0 f1_score: Tensor exact_match: Tensor diff --git a/src/torchmetrics/text/ter.py b/src/torchmetrics/text/ter.py index 35cc197790d..135a5966fbc 100644 --- a/src/torchmetrics/text/ter.py +++ b/src/torchmetrics/text/ter.py @@ -62,6 +62,8 @@ class TranslationEditRate(Metric): is_differentiable: bool = False higher_is_better: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 total_num_edits: Tensor total_tgt_len: Tensor diff --git a/src/torchmetrics/text/wer.py b/src/torchmetrics/text/wer.py index 2d62438a292..eebd3406be0 100644 --- a/src/torchmetrics/text/wer.py +++ b/src/torchmetrics/text/wer.py @@ -66,6 +66,8 @@ class WordErrorRate(Metric): is_differentiable: bool = False higher_is_better: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 errors: Tensor total: Tensor diff --git a/src/torchmetrics/text/wil.py b/src/torchmetrics/text/wil.py index 698854366f0..c314ae067d8 100644 --- a/src/torchmetrics/text/wil.py +++ b/src/torchmetrics/text/wil.py @@ -63,6 +63,8 @@ class WordInfoLost(Metric): is_differentiable: bool = False higher_is_better: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 errors: Tensor target_total: Tensor diff --git a/src/torchmetrics/text/wip.py b/src/torchmetrics/text/wip.py index 992d6021eca..ef79df06a3e 100644 --- a/src/torchmetrics/text/wip.py +++ b/src/torchmetrics/text/wip.py @@ -64,6 +64,8 @@ class WordInfoPreserved(Metric): is_differentiable: bool = False higher_is_better: bool = False full_state_update: bool = False + plot_lower_bound: float = 0.0 + plot_upper_bound: float = 1.0 errors: Tensor preds_total: Tensor