Skip to content

Commit

Permalink
Remove deprecated metrics (#545)
Browse files Browse the repository at this point in the history
Co-authored-by: Jirka Borovec <[email protected]>
  • Loading branch information
SkafteNicki and Borda authored Sep 25, 2021
1 parent 5e2a701 commit fbdc3eb
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 165 deletions.
3 changes: 1 addition & 2 deletions torchmetrics/functional/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from torchmetrics.functional.classification.hamming_distance import hamming_distance
from torchmetrics.functional.classification.hinge import hinge
from torchmetrics.functional.classification.iou import iou
from torchmetrics.functional.classification.kl_divergence import kl_divergence, kldivergence
from torchmetrics.functional.classification.kl_divergence import kl_divergence
from torchmetrics.functional.classification.matthews_corrcoef import matthews_corrcoef
from torchmetrics.functional.classification.precision_recall import precision, precision_recall, recall
from torchmetrics.functional.classification.precision_recall_curve import precision_recall_curve
Expand All @@ -45,7 +45,6 @@
from torchmetrics.functional.regression.mean_squared_log_error import mean_squared_log_error
from torchmetrics.functional.regression.pearson import pearson_corrcoef
from torchmetrics.functional.regression.r2 import r2_score
from torchmetrics.functional.regression.r2score import r2score
from torchmetrics.functional.regression.spearman import spearman_corrcoef
from torchmetrics.functional.regression.symmetric_mean_absolute_percentage_error import (
symmetric_mean_absolute_percentage_error,
Expand Down
19 changes: 0 additions & 19 deletions torchmetrics/functional/classification/kl_divergence.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

from typing import Optional, Tuple
from warnings import warn

import torch
from torch import Tensor
Expand Down Expand Up @@ -109,21 +108,3 @@ def kl_divergence(p: Tensor, q: Tensor, log_prob: bool = False, reduction: Optio
"""
measures, total = _kld_update(p, q, log_prob)
return _kld_compute(measures, total, reduction)


def kldivergence(p: Tensor, q: Tensor, log_prob: bool = False, reduction: Optional[str] = "mean") -> Tensor:
r"""Computes `KL divergence`_
.. deprecated:: v0.5
`kldivergence` was renamed as `kl_divergence` in v0.5 and it will be removed in v0.6
Example:
>>> import torch
>>> from torchmetrics.functional import kldivergence
>>> p = torch.tensor([[0.36, 0.48, 0.16]])
>>> q = torch.tensor([[1/3, 1/3, 1/3]])
>>> kldivergence(p, q)
tensor(0.0853)
"""
warn("`kldivergence` was renamed as `kl_divergence` in v0.5 and it will be removed in v0.6", DeprecationWarning)
return kl_divergence(p, q, log_prob, reduction)
45 changes: 0 additions & 45 deletions torchmetrics/functional/nlp.py

This file was deleted.

1 change: 0 additions & 1 deletion torchmetrics/functional/regression/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,5 @@
from torchmetrics.functional.regression.mean_squared_log_error import mean_squared_log_error # noqa: F401
from torchmetrics.functional.regression.pearson import pearson_corrcoef # noqa: F401
from torchmetrics.functional.regression.r2 import r2_score # noqa: F401
from torchmetrics.functional.regression.r2score import r2score # noqa: F401
from torchmetrics.functional.regression.spearman import spearman_corrcoef # noqa: F401
from torchmetrics.functional.regression.tweedie_deviance import tweedie_deviance_score # noqa: F401
47 changes: 0 additions & 47 deletions torchmetrics/functional/regression/r2score.py

This file was deleted.

51 changes: 0 additions & 51 deletions torchmetrics/regression/r2score.py

This file was deleted.

0 comments on commit fbdc3eb

Please sign in to comment.