Skip to content

Commit

Permalink
Merge branch 'master' into doc/gov
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda authored Dec 10, 2021
2 parents d8440ee + 8fade87 commit 2248be6
Show file tree
Hide file tree
Showing 67 changed files with 175 additions and 188 deletions.
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ repos:
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
# - id: check-json
- id: check-yaml
- id: check-toml
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-toml
- id: check-case-conflict
- id: check-added-large-files
args: ['--maxkb=250', '--enforce-all']
Expand Down
18 changes: 6 additions & 12 deletions torchmetrics/aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ class BaseAggregator(Metric):
compute_on_step:
Forward only calls ``update()`` and returns None if this is
set to False. default: True
set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called.
default: None (which selects the entire world)
dist_sync_fn:
Callback that performs the allgather operation on the metric state.
When `None`, DDP will be used to perform the allgather.
Expand Down Expand Up @@ -122,13 +121,12 @@ class MaxMetric(BaseAggregator):
compute_on_step:
Forward only calls ``update()`` and returns None if this is
set to False. default: True
set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called.
default: None (which selects the entire world)
dist_sync_fn:
Callback that performs the allgather operation on the metric state.
When `None`, DDP will be used to perform the allgather.
Expand Down Expand Up @@ -188,13 +186,12 @@ class MinMetric(BaseAggregator):
compute_on_step:
Forward only calls ``update()`` and returns None if this is
set to False. default: True
set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called.
default: None (which selects the entire world)
dist_sync_fn:
Callback that performs the allgather operation on the metric state.
When `None`, DDP will be used to perform the allgather.
Expand Down Expand Up @@ -254,13 +251,12 @@ class SumMetric(BaseAggregator):
compute_on_step:
Forward only calls ``update()`` and returns None if this is
set to False. default: True
set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called.
default: None (which selects the entire world)
dist_sync_fn:
Callback that performs the allgather operation on the metric state.
When `None`, DDP will be used to perform the allgather.
Expand Down Expand Up @@ -313,13 +309,12 @@ class CatMetric(BaseAggregator):
compute_on_step:
Forward only calls ``update()`` and returns None if this is
set to False. default: True
set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called.
default: None (which selects the entire world)
dist_sync_fn:
Callback that performs the allgather operation on the metric state.
When `None`, DDP will be used to perform the allgather.
Expand Down Expand Up @@ -377,13 +372,12 @@ class MeanMetric(BaseAggregator):
compute_on_step:
Forward only calls ``update()`` and returns None if this is
set to False. default: True
set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called.
default: None (which selects the entire world)
dist_sync_fn:
Callback that performs the allgather operation on the metric state.
When `None`, DDP will be used to perform the allgather.
Expand Down
4 changes: 2 additions & 2 deletions torchmetrics/audio/pit.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ class PIT(Metric):
the function to find the best permutation, can be 'min' or 'max', i.e. the smaller the better
or the larger the better.
compute_on_step:
Forward only calls ``update()`` and returns None if this is set to False. default: True
Forward only calls ``update()`` and returns None if this is set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called. default: None (which selects the entire world)
Specify the process group on which synchronization is called.
dist_sync_fn:
Callback that performs the allgather operation on the metric state. When `None`, DDP
will be used to perform the allgather.
Expand Down
4 changes: 2 additions & 2 deletions torchmetrics/audio/sdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ class SDR(Metric):
This can help stabilize the metric in the case where some of the reference
signals may sometimes be zero
compute_on_step:
Forward only calls ``update()`` and returns None if this is set to False. default: True
Forward only calls ``update()`` and returns None if this is set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called. default: None (which selects the entire world)
Specify the process group on which synchronization is called.
dist_sync_fn:
Callback that performs the allgather operation on the metric state. When `None`, DDP
will be used to perform the allgather.
Expand Down
4 changes: 2 additions & 2 deletions torchmetrics/audio/si_sdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ class SI_SDR(Metric):
zero_mean:
if to zero mean target and preds or not
compute_on_step:
Forward only calls ``update()`` and returns None if this is set to False. default: True
Forward only calls ``update()`` and returns None if this is set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called. default: None (which selects the entire world)
Specify the process group on which synchronization is called.
dist_sync_fn:
Callback that performs the allgather operation on the metric state. When `None`, DDP
will be used to perform the allgather.
Expand Down
4 changes: 2 additions & 2 deletions torchmetrics/audio/si_snr.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ class SI_SNR(Metric):
Args:
compute_on_step:
Forward only calls ``update()`` and returns None if this is set to False. default: True
Forward only calls ``update()`` and returns None if this is set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called. default: None (which selects the entire world)
Specify the process group on which synchronization is called.
dist_sync_fn:
Callback that performs the allgather operation on the metric state. When `None`, DDP
will be used to perform the allgather.
Expand Down
4 changes: 2 additions & 2 deletions torchmetrics/audio/snr.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ class SNR(Metric):
zero_mean:
if to zero mean target and preds or not
compute_on_step:
Forward only calls ``update()`` and returns None if this is set to False. default: True
Forward only calls ``update()`` and returns None if this is set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called. default: None (which selects the entire world)
Specify the process group on which synchronization is called.
dist_sync_fn:
Callback that performs the allgather operation on the metric state. When `None`, DDP
will be used to perform the allgather.
Expand Down
4 changes: 2 additions & 2 deletions torchmetrics/audio/stoi.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ class STOI(Metric):
extended:
whether to use the extended STOI described in [4]
compute_on_step:
Forward only calls ``update()`` and returns None if this is set to False. default: True
Forward only calls ``update()`` and returns None if this is set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called. default: None (which selects the entire world)
Specify the process group on which synchronization is called.
dist_sync_fn:
Callback that performs the allgather operation on the metric state. When `None`, DDP
will be used to perform the allgather.
Expand Down
2 changes: 1 addition & 1 deletion torchmetrics/classification/auc.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class AUC(Metric):
Synchronize metric state across processes at each ``forward()``
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called. default: None (which selects the entire world)
Specify the process group on which synchronization is called.
dist_sync_fn:
Callback that performs the ``allgather`` operation on the metric state. When ``None``, DDP
will be used to perform the ``allgather``.
Expand Down
5 changes: 3 additions & 2 deletions torchmetrics/classification/auroc.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ class AUROC(Metric):
If not ``None``, calculates standardized partial AUC over the
range [0, max_fpr]. Should be a float between 0 and 1.
compute_on_step:
Forward only calls ``update()`` and return None if this is set to False. default: True
Forward only calls ``update()`` and return None if this is set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called. default: None (which selects the entire world)
Specify the process group on which synchronization is called.
dist_sync_fn:
Callback that performs the allgather operation on the metric state. When ``None``, DDP
will be used to perform the allgather
Expand Down
6 changes: 3 additions & 3 deletions torchmetrics/classification/avg_precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ class AveragePrecision(Metric):
the metric for every class.
compute_on_step:
Forward only calls ``update()`` and return None if this is set to False. default: True
Forward only calls ``update()`` and return None if this is set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step. default: False
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called. default: None (which selects the entire world)
Specify the process group on which synchronization is called.
Example (binary case):
>>> from torchmetrics import AveragePrecision
Expand Down
14 changes: 7 additions & 7 deletions torchmetrics/classification/binned_precision_recall.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ class BinnedPrecisionRecallCurve(Metric):
It is used for computation will lead to more detailed curve and accurate estimates,
but will be slower and consume more memory.
compute_on_step:
Forward only calls ``update()`` and return None if this is set to False. default: True
Forward only calls ``update()`` and return None if this is set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step. default: False
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called. default: None (which selects the entire world)
Specify the process group on which synchronization is called.
Raises:
ValueError:
Expand Down Expand Up @@ -210,9 +210,9 @@ class BinnedAveragePrecision(BinnedPrecisionRecallCurve):
It is used for computation will lead to more detailed curve and accurate estimates,
but will be slower and consume more memory
compute_on_step:
Forward only calls ``update()`` and return None if this is set to False. default: True
Forward only calls ``update()`` and return None if this is set to False.
process_group:
Specify the process group on which synchronization is called. default: None (which selects the entire world)
Specify the process group on which synchronization is called.
Raises:
ValueError:
Expand Down Expand Up @@ -262,9 +262,9 @@ class BinnedRecallAtFixedPrecision(BinnedPrecisionRecallCurve):
It is used for computation will lead to more detailed curve and accurate estimates,
but will be slower and consume more memory
compute_on_step:
Forward only calls ``update()`` and return None if this is set to False. default: True
Forward only calls ``update()`` and return None if this is set to False.
process_group:
Specify the process group on which synchronization is called. default: None (which selects the entire world)
Specify the process group on which synchronization is called.
Raises:
ValueError:
Expand Down
1 change: 0 additions & 1 deletion torchmetrics/classification/calibration_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class CalibrationError(Metric):
dist_sync_on_step: Synchronize metric state across processes at each ``forward()``
before returning the value at the step
process_group: Specify the process group on which synchronization is called.
default: None (which selects the entire world)
"""
DISTANCES = {"l1", "l2", "max"}
higher_is_better = False
Expand Down
6 changes: 3 additions & 3 deletions torchmetrics/classification/cohen_kappa.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ class labels.
of binary or multi-label inputs. Default value of 0.5 corresponds to input being probabilities.
compute_on_step:
Forward only calls ``update()`` and return None if this is set to False. default: True
Forward only calls ``update()`` and return None if this is set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step. default: False
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called. default: None (which selects the entire world)
Specify the process group on which synchronization is called.
Example:
>>> from torchmetrics import CohenKappa
Expand Down
6 changes: 3 additions & 3 deletions torchmetrics/classification/confusion_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ class ConfusionMatrix(Metric):
multilabel:
determines if data is multilabel or not.
compute_on_step:
Forward only calls ``update()`` and return None if this is set to False. default: True
Forward only calls ``update()`` and return None if this is set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step. default: False
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called. default: None (which selects the entire world)
Specify the process group on which synchronization is called.
Example (binary data):
>>> from torchmetrics import ConfusionMatrix
Expand Down
2 changes: 1 addition & 1 deletion torchmetrics/classification/jaccard.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class JaccardIndex(ConfusionMatrix):
Synchronize metric state across processes at each ``forward()``
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called. default: None (which selects the entire world)
Specify the process group on which synchronization is called.
Example:
>>> from torchmetrics import JaccardIndex
Expand Down
8 changes: 4 additions & 4 deletions torchmetrics/classification/matthews_corrcoef.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ class MatthewsCorrcoef(Metric):
Args:
num_classes: Number of classes in the dataset.
threshold:
Threshold value for binary or multi-label probabilites. default: 0.5
Threshold value for binary or multi-label probabilites.
compute_on_step:
Forward only calls ``update()`` and return None if this is set to False. default: True
Forward only calls ``update()`` and return None if this is set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step. default: False
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called. default: None (which selects the entire world)
Specify the process group on which synchronization is called.
dist_sync_fn:
Callback that performs the allgather operation on the metric state. When ``None``, DDP
will be used to perform the allgather
Expand Down
6 changes: 3 additions & 3 deletions torchmetrics/classification/precision_recall_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ class PrecisionRecallCurve(Metric):
this argument should not be set as we iteratively change it in the
range [0,num_classes-1]
compute_on_step:
Forward only calls ``update()`` and return None if this is set to False. default: True
Forward only calls ``update()`` and return None if this is set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step. default: False
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called. default: None (which selects the entire world)
Specify the process group on which synchronization is called.
Example (binary case):
>>> from torchmetrics import PrecisionRecallCurve
Expand Down
6 changes: 3 additions & 3 deletions torchmetrics/classification/roc.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ class ROC(Metric):
this argument should not be set as we iteratively change it in the
range [0,num_classes-1]
compute_on_step:
Forward only calls ``update()`` and return None if this is set to False. default: True
Forward only calls ``update()`` and return None if this is set to False.
dist_sync_on_step:
Synchronize metric state across processes at each ``forward()``
before returning the value at the step. default: False
before returning the value at the step.
process_group:
Specify the process group on which synchronization is called. default: None (which selects the entire world)
Specify the process group on which synchronization is called.
dist_sync_fn:
Callback that performs the allgather operation on the metric state. When ``None``, DDP
will be used to perform the allgather
Expand Down
Loading

0 comments on commit 2248be6

Please sign in to comment.