Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newmetric: NRMSE #2442

Merged
merged 61 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
aa1457f
init files
SkafteNicki Mar 9, 2024
58b7577
docs
SkafteNicki Mar 9, 2024
7933f61
requirements for testing
SkafteNicki Mar 9, 2024
ba8848a
changelog
SkafteNicki Mar 9, 2024
0bf7f56
add class interface
SkafteNicki Mar 9, 2024
b6c7011
add tests
SkafteNicki Mar 9, 2024
50e65a5
Merge branch 'master' into newmetric/nrmse
Borda Mar 28, 2024
1100cda
Merge branch 'master' into newmetric/nrmse
Borda Apr 10, 2024
8b962d0
Merge branch 'master' into newmetric/nrmse
SkafteNicki Apr 24, 2024
a95809b
Merge branch 'master' into newmetric/nrmse
Borda Apr 24, 2024
9a40d9b
Merge branch 'master' into newmetric/nrmse
SkafteNicki May 31, 2024
642dd27
Update NRMSE computation with normalization options
SkafteNicki May 31, 2024
b5a2e42
Merge branch 'master' into newmetric/nrmse
SkafteNicki May 31, 2024
84604ad
try fixing docs
SkafteNicki May 31, 2024
0271d91
fix mypy
SkafteNicki May 31, 2024
d279774
fix naming of file
SkafteNicki May 31, 2024
c58fe84
Merge branch 'master' into newmetric/nrmse
Borda Jun 2, 2024
d9b6783
Merge branch 'master' into newmetric/nrmse
Borda Jun 4, 2024
42ffbea
Apply suggestions from code review
Borda Jun 5, 2024
2163188
Merge branch 'master' into newmetric/nrmse
Borda Jul 16, 2024
b5a0e22
Merge branch 'master' into newmetric/nrmse
Borda Jul 16, 2024
5be2218
Merge branch 'master' into newmetric/nrmse
Borda Jul 22, 2024
f194e0f
Merge branch 'master' into newmetric/nrmse
Borda Jul 24, 2024
a863b07
Merge branch 'master' into newmetric/nrmse
Borda Aug 5, 2024
8ec09c9
Merge branch 'master' into newmetric/nrmse
Borda Sep 9, 2024
0693545
add l2 option
SkafteNicki Oct 11, 2024
5267245
added tests for argument error validation
SkafteNicki Oct 11, 2024
c9c8350
Merge branch 'master' into newmetric/nrmse
SkafteNicki Oct 11, 2024
b967aa0
fix doctest
SkafteNicki Oct 11, 2024
4d57398
fix plotting code + test
SkafteNicki Oct 11, 2024
2d26828
fix part of tests
SkafteNicki Oct 11, 2024
6f7c821
fix implementation
SkafteNicki Oct 11, 2024
83e2f77
fix doctest
SkafteNicki Oct 11, 2024
c2714b1
Merge branch 'master' into newmetric/nrmse
SkafteNicki Oct 11, 2024
01d19b6
skip failing tests
SkafteNicki Oct 11, 2024
fae8898
Merge branch 'newmetric/nrmse' of https://github.com/Lightning-AI/tor…
SkafteNicki Oct 11, 2024
b7a116d
fix ddp testing
SkafteNicki Oct 11, 2024
a1d44ac
Merge branch 'master' into newmetric/nrmse
SkafteNicki Oct 12, 2024
6043801
try fixing ddp issues, cannot reproduce locally
SkafteNicki Oct 12, 2024
2e6e5e3
fix doctests
SkafteNicki Oct 12, 2024
62f240a
remove print
SkafteNicki Oct 14, 2024
0b09f18
Merge branch 'master' into newmetric/nrmse
SkafteNicki Oct 14, 2024
515ae49
Merge branch 'master' into newmetric/nrmse
Borda Oct 14, 2024
6e553da
Merge branch 'master' into newmetric/nrmse
SkafteNicki Oct 15, 2024
da58815
add debug print temp
SkafteNicki Oct 15, 2024
ec7f070
lower atol
SkafteNicki Oct 15, 2024
7fffab4
Merge branch 'master' into newmetric/nrmse
mergify[bot] Oct 15, 2024
0dd6448
Merge branch 'master' into newmetric/nrmse
Borda Oct 15, 2024
47c294e
readd debug print
SkafteNicki Oct 18, 2024
c5e7b26
more debugging
SkafteNicki Oct 18, 2024
3f78fea
Merge branch 'master' into newmetric/nrmse
mergify[bot] Oct 18, 2024
1e716de
Merge branch 'master' into newmetric/nrmse
Borda Oct 18, 2024
0c6718a
improve testing instructions
SkafteNicki Oct 19, 2024
67925cb
fix math
SkafteNicki Oct 19, 2024
19c3ef2
Merge branch 'newmetric/nrmse' of https://github.com/Lightning-AI/tor…
SkafteNicki Oct 19, 2024
64654e3
Merge branch 'master' into newmetric/nrmse
mergify[bot] Oct 21, 2024
d160e93
link
Borda Oct 21, 2024
25def40
Merge branch 'master' into newmetric/nrmse
Borda Oct 21, 2024
9b2aa90
Merge branch 'master' into newmetric/nrmse
Borda Oct 22, 2024
f53f0b4
Merge branch 'master' into newmetric/nrmse
mergify[bot] Oct 22, 2024
4cb0a0c
Merge branch 'master' into newmetric/nrmse
mergify[bot] Oct 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

-
- Added `NormalizedRootMeanSquaredError` metric to regression subpackage ([#2442](https://github.com/Lightning-AI/torchmetrics/pull/2442))


### Changed
Expand Down
3 changes: 3 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,9 @@ def linkcode_resolve(domain, info) -> Optional[str]: # noqa: ANN001
"https://aclanthology.org/W17-4770",
# A wavelet transform method to merge Landsat TM and SPOT panchromatic data
"https://www.ingentaconnect.com/content/tandf/tres/1998/00000019/00000004/art00013",
# Improved normalization of time-lapse seismic data using normalized root mean square repeatability data ...
# ... to improve automatic production and seismic history matching in the Nelson field
"https://onlinelibrary.wiley.com/doi/abs/10.1111/1365-2478.12109",
# todo: these links seems to be unstable, referring to .devcontainer
"https://code.visualstudio.com",
"https://code.visualstudio.com/.*",
Expand Down
1 change: 1 addition & 0 deletions docs/source/links.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
.. _FLORES-200: https://arxiv.org/abs/2207.04672
.. _averaging curve objects: https://scikit-learn.org/stable/auto_examples/model_selection/plot_roc.html
.. _SCC: https://www.ingentaconnect.com/content/tandf/tres/1998/00000019/00000004/art00013
.. _Normalized Root Mean Squared Error: https://onlinelibrary.wiley.com/doi/abs/10.1111/1365-2478.12109
.. _Generalized Dice Score: https://arxiv.org/abs/1707.03237
.. _Hausdorff Distance: https://en.wikipedia.org/wiki/Hausdorff_distance
.. _averaging curve objects: https://scikit-learn.org/stable/auto_examples/model_selection/plot_roc.html
Expand Down
21 changes: 21 additions & 0 deletions docs/source/regression/normalized_root_mean_squared_error.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. customcarditem::
:header: Normalized Root Mean Squared Error (NRMSE)
:image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg
:tags: Regression

.. include:: ../links.rst

##########################################
Normalized Root Mean Squared Error (NRMSE)
##########################################

Module Interface
________________

.. autoclass:: torchmetrics.NormalizedRootMeanSquaredError
:exclude-members: update, compute

Functional Interface
____________________

.. autofunction:: torchmetrics.functional.normalized_root_mean_squared_error
1 change: 1 addition & 0 deletions requirements/_devel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
-r classification_test.txt
-r nominal_test.txt
-r segmentation_test.txt
-r regression_test.txt
1 change: 1 addition & 0 deletions requirements/regression_test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
permetrics==2.0.0
36 changes: 19 additions & 17 deletions src/torchmetrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
MeanSquaredError,
MeanSquaredLogError,
MinkowskiDistance,
NormalizedRootMeanSquaredError,
PearsonCorrCoef,
R2Score,
RelativeSquaredError,
Expand Down Expand Up @@ -158,25 +159,23 @@
)

__all__ = [
"functional",
"Accuracy",
"AUROC",
"Accuracy",
"AveragePrecision",
"BLEUScore",
"BootStrapper",
"CHRFScore",
"CalibrationError",
"CatMetric",
"ClasswiseWrapper",
"CharErrorRate",
"CHRFScore",
"ConcordanceCorrCoef",
"ClasswiseWrapper",
"CohenKappa",
"ConcordanceCorrCoef",
"ConfusionMatrix",
"CosineSimilarity",
"CramersV",
"CriticalSuccessIndex",
"Dice",
"TweedieDevianceScore",
"ErrorRelativeGlobalDimensionlessSynthesis",
"ExactMatch",
"ExplainedVariance",
Expand All @@ -187,8 +186,8 @@
"HammingDistance",
"HingeLoss",
"JaccardIndex",
"KendallRankCorrCoef",
"KLDivergence",
"KendallRankCorrCoef",
"LogCoshError",
"MatchErrorRate",
"MatthewsCorrCoef",
Expand All @@ -201,23 +200,25 @@
"Metric",
"MetricCollection",
"MetricTracker",
"MinkowskiDistance",
"MinMaxMetric",
"MinMetric",
"MinkowskiDistance",
"ModifiedPanopticQuality",
"MultiScaleStructuralSimilarityIndexMeasure",
"MultioutputWrapper",
"MultitaskWrapper",
"MultiScaleStructuralSimilarityIndexMeasure",
"NormalizedRootMeanSquaredError",
"PanopticQuality",
"PeakSignalNoiseRatio",
"PearsonCorrCoef",
"PearsonsContingencyCoefficient",
"PermutationInvariantTraining",
"Perplexity",
"Precision",
"PrecisionAtFixedRecall",
"PrecisionRecallCurve",
"PeakSignalNoiseRatio",
"R2Score",
"ROC",
"Recall",
"RecallAtFixedPrecision",
"RelativeAverageSpectralError",
Expand All @@ -228,37 +229,38 @@
"RetrievalMRR",
"RetrievalNormalizedDCG",
"RetrievalPrecision",
"RetrievalRecall",
"RetrievalRPrecision",
"RetrievalPrecisionRecallCurve",
"RetrievalRPrecision",
"RetrievalRecall",
"RetrievalRecallAtFixedPrecision",
"ROC",
"RootMeanSquaredErrorUsingSlidingWindow",
"RunningMean",
"RunningSum",
"SQuAD",
"SacreBLEUScore",
"SignalDistortionRatio",
"ScaleInvariantSignalDistortionRatio",
"ScaleInvariantSignalNoiseRatio",
"SensitivityAtSpecificity",
"SignalDistortionRatio",
"SignalNoiseRatio",
"SpearmanCorrCoef",
"Specificity",
"SpecificityAtSensitivity",
"SensitivityAtSpecificity",
"SpectralAngleMapper",
"SpectralDistortionIndex",
"SQuAD",
"StructuralSimilarityIndexMeasure",
"StatScores",
"StructuralSimilarityIndexMeasure",
"SumMetric",
"SymmetricMeanAbsolutePercentageError",
"TheilsU",
"TotalVariation",
"TranslationEditRate",
"TschuprowsT",
"TweedieDevianceScore",
"UniversalImageQualityIndex",
"WeightedMeanAbsolutePercentageError",
"WordErrorRate",
"WordInfoLost",
"WordInfoPreserved",
"functional",
]
24 changes: 13 additions & 11 deletions src/torchmetrics/functional/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
mean_squared_error,
mean_squared_log_error,
minkowski_distance,
normalized_root_mean_squared_error,
pearson_corrcoef,
r2_score,
relative_squared_error,
Expand Down Expand Up @@ -146,14 +147,13 @@
"calibration_error",
"char_error_rate",
"chrf_score",
"concordance_corrcoef",
"cohen_kappa",
"concordance_corrcoef",
"confusion_matrix",
"cosine_similarity",
"cramers_v",
"cramers_v_matrix",
"critical_success_index",
"tweedie_deviance_score",
"dice",
"error_relative_global_dimensionless_synthesis",
"exact_match",
Expand All @@ -177,63 +177,65 @@
"mean_squared_log_error",
"minkowski_distance",
"multiscale_structural_similarity_index_measure",
"normalized_root_mean_squared_error",
"pairwise_cosine_similarity",
"pairwise_euclidean_distance",
"pairwise_linear_similarity",
"pairwise_manhattan_distance",
"pairwise_minkowski_distance",
"panoptic_quality",
"peak_signal_noise_ratio",
"pearson_corrcoef",
"pearsons_contingency_coefficient",
"pearsons_contingency_coefficient_matrix",
"permutation_invariant_training",
"perplexity",
"pit_permutate",
"precision",
"precision_at_fixed_recall",
SkafteNicki marked this conversation as resolved.
Show resolved Hide resolved
"precision_recall_curve",
"peak_signal_noise_ratio",
"r2_score",
"recall",
"recall_at_fixed_precision",
"relative_average_spectral_error",
"relative_squared_error",
"retrieval_average_precision",
"retrieval_fall_out",
"retrieval_hit_rate",
"retrieval_normalized_dcg",
"retrieval_precision",
"retrieval_precision_recall_curve",
"retrieval_r_precision",
"retrieval_recall",
"retrieval_reciprocal_rank",
"retrieval_precision_recall_curve",
"roc",
"root_mean_squared_error_using_sliding_window",
"rouge_score",
"sacre_bleu_score",
"signal_distortion_ratio",
"scale_invariant_signal_distortion_ratio",
"scale_invariant_signal_noise_ratio",
"sensitivity_at_specificity",
"signal_distortion_ratio",
"signal_noise_ratio",
"spearman_corrcoef",
"specificity",
"specificity_at_sensitivity",
"spectral_angle_mapper",
"spectral_distortion_index",
"squad",
"structural_similarity_index_measure",
"stat_scores",
"structural_similarity_index_measure",
"symmetric_mean_absolute_percentage_error",
"theils_u",
"theils_u_matrix",
"total_variation",
"translation_edit_rate",
"tschuprows_t",
"tschuprows_t_matrix",
"tweedie_deviance_score",
"universal_image_quality_index",
"spectral_angle_mapper",
"weighted_mean_absolute_percentage_error",
"word_error_rate",
"word_information_lost",
"word_information_preserved",
"precision_at_fixed_recall",
"recall_at_fixed_precision",
"sensitivity_at_specificity",
"specificity_at_sensitivity",
]
8 changes: 5 additions & 3 deletions src/torchmetrics/functional/regression/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from torchmetrics.functional.regression.mape import mean_absolute_percentage_error
from torchmetrics.functional.regression.minkowski import minkowski_distance
from torchmetrics.functional.regression.mse import mean_squared_error
from torchmetrics.functional.regression.nrmse import normalized_root_mean_squared_error
from torchmetrics.functional.regression.pearson import pearson_corrcoef
from torchmetrics.functional.regression.r2 import r2_score
from torchmetrics.functional.regression.rse import relative_squared_error
Expand All @@ -39,13 +40,14 @@
"kendall_rank_corrcoef",
"kl_divergence",
"log_cosh_error",
"mean_squared_log_error",
"mean_absolute_error",
"mean_squared_error",
"pearson_corrcoef",
"mean_absolute_percentage_error",
"mean_absolute_percentage_error",
"mean_squared_error",
"mean_squared_log_error",
"minkowski_distance",
"normalized_root_mean_squared_error",
"pearson_corrcoef",
"r2_score",
"relative_squared_error",
"spearman_corrcoef",
Expand Down
Loading
Loading