Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
SkafteNicki committed Sep 26, 2021
1 parent 16248b1 commit 4722820
Show file tree
Hide file tree
Showing 13 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion torchmetrics/audio/si_sdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class SI_SDR(Metric):
"""
sum_si_sdr: Tensor
total: Tensor
higher_is_better: bool = True
higher_is_better = True

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion torchmetrics/audio/si_snr.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class SI_SNR(Metric):

sum_si_snr: Tensor
total: Tensor
higher_is_better: bool = True
higher_is_better = True

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion torchmetrics/retrieval/mean_average_precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class RetrievalMAP(RetrievalMetric):
>>> rmap(preds, target, indexes=indexes)
tensor(0.7917)
"""
higher_is_better: bool = True
higher_is_better = True

def _metric(self, preds: Tensor, target: Tensor) -> Tensor:
return retrieval_average_precision(preds, target)
2 changes: 1 addition & 1 deletion torchmetrics/retrieval/mean_reciprocal_rank.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class RetrievalMRR(RetrievalMetric):
>>> mrr(preds, target, indexes=indexes)
tensor(0.7500)
"""
higher_is_better: bool = True
higher_is_better = True

def _metric(self, preds: Tensor, target: Tensor) -> Tensor:
return retrieval_reciprocal_rank(preds, target)
2 changes: 1 addition & 1 deletion torchmetrics/retrieval/retrieval_fallout.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class RetrievalFallOut(RetrievalMetric):
>>> fo(preds, target, indexes=indexes)
tensor(0.5000)
"""
higher_is_better: bool = False
higher_is_better = False

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion torchmetrics/retrieval/retrieval_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class RetrievalMetric(Metric, ABC):
indexes: List[Tensor]
preds: List[Tensor]
target: List[Tensor]
higher_is_better: bool = True
higher_is_better = True

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion torchmetrics/retrieval/retrieval_ndcg.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class RetrievalNormalizedDCG(RetrievalMetric):
>>> ndcg(preds, target, indexes=indexes)
tensor(0.8467)
"""
higher_is_better: bool = True
higher_is_better = True

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion torchmetrics/retrieval/retrieval_precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class RetrievalPrecision(RetrievalMetric):
>>> p2(preds, target, indexes=indexes)
tensor(0.5000)
"""
higher_is_better: bool = True
higher_is_better = True

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion torchmetrics/retrieval/retrieval_recall.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class RetrievalRecall(RetrievalMetric):
>>> r2(preds, target, indexes=indexes)
tensor(0.7500)
"""
higher_is_better: bool = True
higher_is_better = True

def __init__(
self,
Expand Down
1 change: 0 additions & 1 deletion torchmetrics/text/bert.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ class BERTScore(Metric):
'recall': [0.99..., 0.99...],
'f1': [0.99..., 0.99...]}
"""

higher_is_better = True

def __init__(
Expand Down
1 change: 0 additions & 1 deletion torchmetrics/text/bleu.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class BLEUScore(Metric):
[2] Automatic Evaluation of Machine Translation Quality Using Longest Common Subsequence
and Skip-Bigram Statistics by Chin-Yew Lin and Franz Josef Och `Machine Translation Evolution`_
"""

trans_len: Tensor
ref_len: Tensor
numerator: Tensor
Expand Down
1 change: 0 additions & 1 deletion torchmetrics/text/rouge.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class ROUGEScore(Metric):
References:
[1] ROUGE: A Package for Automatic Evaluation of Summaries by Chin-Yew Lin `Rouge Detail`_
"""

higher_is_better = True

def __init__(
Expand Down
1 change: 0 additions & 1 deletion torchmetrics/text/wer.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class WER(Metric):
>>> metric(predictions, references)
tensor(0.5000)
"""

error: Tensor
total: Tensor
higher_is_better = False
Expand Down

0 comments on commit 4722820

Please sign in to comment.