* folders

* common / advanced / extensions

* paths

* flake8

* isort

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit b56c19af91a8c8a7e66bd4bd20b869aff5be3b92)
This commit is contained in:
Jirka Borovec 2021-01-26 21:07:07 +01:00 коммит произвёл Jirka Borovec
Родитель 7904df201b
Коммит 380938da1a
9 изменённых файлов: 40 добавлений и 35 удалений

Просмотреть файл

@ -38,7 +38,7 @@ class Accuracy(Metric):
changed to subset accuracy (which requires all labels or sub-samples in the sample to
be correctly predicted) by setting ``subset_accuracy=True``.
Accepts all input types listed in :ref:`metrics:Input types`.
Accepts all input types listed in :ref:`extensions/metrics:input types`.
Args:
threshold:
@ -127,7 +127,7 @@ class Accuracy(Metric):
def update(self, preds: torch.Tensor, target: torch.Tensor):
"""
Update state with predictions and targets. See :ref:`metrics:Input types` for more information
Update state with predictions and targets. See :ref:`extensions/metrics:input types` for more information
on input types.
Args:

Просмотреть файл

@ -35,7 +35,7 @@ class HammingDistance(Metric):
treats each possible label separately - meaning that, for example, multi-class data is
treated as if it were multi-label.
Accepts all input types listed in :ref:`metrics:Input types`.
Accepts all input types listed in :ref:`extensions/metrics:input types`.
Args:
threshold:
@ -88,7 +88,7 @@ class HammingDistance(Metric):
def update(self, preds: torch.Tensor, target: torch.Tensor):
"""
Update state with predictions and targets. See :ref:`metrics:Input types` for more information
Update state with predictions and targets. See :ref:`extensions/metrics:input types` for more information
on input types.
Args:

Просмотреть файл

@ -250,7 +250,7 @@ def _check_classification_inputs(
is_multiclass:
Used only in certain special cases, where you want to treat inputs as a different type
than what they appear to be. See the parameter's
:ref:`documentation section <metrics:Using the is_multiclass parameter>`
:ref:`documentation section <extensions/metrics:using the is_multiclass parameter>`
for a more detailed explanation and examples.
@ -376,7 +376,7 @@ def _input_format_classification(
is_multiclass:
Used only in certain special cases, where you want to treat inputs as a different type
than what they appear to be. See the parameter's
:ref:`documentation section <metrics:Using the is_multiclass parameter>`
:ref:`documentation section <extensions/metrics:using the is_multiclass parameter>`
for a more detailed explanation and examples.

Просмотреть файл

@ -31,7 +31,7 @@ class Precision(StatScores):
The reduction method (how the precision scores are aggregated) is controlled by the
``average`` parameter, and additionally by the ``mdmc_average`` parameter in the
multi-dimensional multi-class case. Accepts all inputs listed in :ref:`metrics:Input types`.
multi-dimensional multi-class case. Accepts all inputs listed in :ref:`extensions/metrics:input types`.
Args:
num_classes:
@ -67,10 +67,11 @@ class Precision(StatScores):
- ``'samplewise'``: In this case, the statistics are computed separately for each
sample on the ``N`` axis, and then averaged over samples.
The computation for each sample is done by treating the flattened extra axes ``...``
(see :ref:`metrics:Input types`) as the ``N`` dimension within the sample,
(see :ref:`extensions/metrics:input types`) as the ``N`` dimension within the sample,
and computing the metric for the sample based on that.
- ``'global'``: In this case the ``N`` and ``...`` dimensions of the inputs (see :ref:`metrics:Input types`)
- ``'global'``: In this case the ``N`` and ``...`` dimensions of the inputs
(see :ref:`extensions/metrics:input types`)
are flattened into a new ``N_X`` sample axis, i.e. the inputs are treated as if they
were ``(N_X, C)``. From here on the ``average`` parameter applies as usual.
@ -89,7 +90,7 @@ class Precision(StatScores):
is_multiclass:
Used only in certain special cases, where you want to treat inputs as a different type
than what they appear to be. See the parameter's
:ref:`documentation section <metrics:Using the is_multiclass parameter>`
:ref:`documentation section <extensions/metrics:using the is_multiclass parameter>`
for a more detailed explanation and examples.
compute_on_step:
@ -180,7 +181,7 @@ class Recall(StatScores):
The reduction method (how the recall scores are aggregated) is controlled by the
``average`` parameter, and additionally by the ``mdmc_average`` parameter in the
multi-dimensional multi-class case. Accepts all inputs listed in :ref:`metrics:Input types`.
multi-dimensional multi-class case. Accepts all inputs listed in :ref:`extensions/metrics:input types`.
Args:
num_classes:
@ -216,10 +217,11 @@ class Recall(StatScores):
- ``'samplewise'``: In this case, the statistics are computed separately for each
sample on the ``N`` axis, and then averaged over samples.
The computation for each sample is done by treating the flattened extra axes ``...``
(see :ref:`metrics:Input types`) as the ``N`` dimension within the sample,
(see :ref:`extensions/metrics:input types`) as the ``N`` dimension within the sample,
and computing the metric for the sample based on that.
- ``'global'``: In this case the ``N`` and ``...`` dimensions of the inputs (see :ref:`metrics:Input types`)
- ``'global'``: In this case the ``N`` and ``...`` dimensions of the inputs
(see :ref:`extensions/metrics:input types`)
are flattened into a new ``N_X`` sample axis, i.e. the inputs are treated as if they
were ``(N_X, C)``. From here on the ``average`` parameter applies as usual.
@ -239,7 +241,7 @@ class Recall(StatScores):
is_multiclass:
Used only in certain special cases, where you want to treat inputs as a different type
than what they appear to be. See the parameter's
:ref:`documentation section <metrics:Using the is_multiclass parameter>`
:ref:`documentation section <extensions/metrics:using the is_multiclass parameter>`
for a more detailed explanation and examples.
compute_on_step:

Просмотреть файл

@ -28,7 +28,7 @@ class StatScores(Metric):
``reduce`` parameter, and additionally by the ``mdmc_reduce`` parameter in the
multi-dimensional multi-class case.
Accepts all inputs listed in :ref:`metrics:Input types`.
Accepts all inputs listed in :ref:`extensions/metrics:input types`.
Args:
threshold:
@ -71,7 +71,7 @@ class StatScores(Metric):
one of the following:
- ``None`` [default]: Should be left unchanged if your data is not multi-dimensional
multi-class (see :ref:`metrics:Input types` for the definition of input types).
multi-class (see :ref:`extensions/metrics:input types` for the definition of input types).
- ``'samplewise'``: In this case, the statistics are computed separately for each
sample on the ``N`` axis, and then the outputs are concatenated together. In each
@ -86,7 +86,7 @@ class StatScores(Metric):
is_multiclass:
Used only in certain special cases, where you want to treat inputs as a different type
than what they appear to be. See the parameter's
:ref:`documentation section <metrics:Using the is_multiclass parameter>`
:ref:`documentation section <extensions/metrics:using the is_multiclass parameter>`
for a more detailed explanation and examples.
compute_on_step:
@ -175,7 +175,7 @@ class StatScores(Metric):
def update(self, preds: torch.Tensor, target: torch.Tensor):
"""
Update state with predictions and targets. See :ref:`metrics:Input types` for more information
Update state with predictions and targets. See :ref:`extensions/metrics:input types` for more information
on input types.
Args:

Просмотреть файл

@ -72,7 +72,7 @@ def accuracy(
changed to subset accuracy (which requires all labels or sub-samples in the sample to
be correctly predicted) by setting ``subset_accuracy=True``.
Accepts all input types listed in :ref:`metrics:Input types`.
Accepts all input types listed in :ref:`extensions/metrics:input types`.
Args:
preds: Predictions from model (probabilities, or labels)

Просмотреть файл

@ -49,7 +49,7 @@ def hamming_distance(preds: torch.Tensor, target: torch.Tensor, threshold: float
treats each possible label separately - meaning that, for example, multi-class data is
treated as if it were multi-label.
Accepts all input types listed in :ref:`metrics:Input types`.
Accepts all input types listed in :ref:`extensions/metrics:input types`.
Args:
preds: Predictions from model

Просмотреть файл

@ -60,7 +60,7 @@ def precision(
The reduction method (how the precision scores are aggregated) is controlled by the
``average`` parameter, and additionally by the ``mdmc_average`` parameter in the
multi-dimensional multi-class case. Accepts all inputs listed in :ref:`metrics:Input types`.
multi-dimensional multi-class case. Accepts all inputs listed in :ref:`extensions/metrics:input types`.
Args:
preds: Predictions from model (probabilities or labels)
@ -94,10 +94,11 @@ def precision(
- ``'samplewise'``: In this case, the statistics are computed separately for each
sample on the ``N`` axis, and then averaged over samples.
The computation for each sample is done by treating the flattened extra axes ``...``
(see :ref:`metrics:Input types`) as the ``N`` dimension within the sample,
(see :ref:`extensions/metrics:input types`) as the ``N`` dimension within the sample,
and computing the metric for the sample based on that.
- ``'global'``: In this case the ``N`` and ``...`` dimensions of the inputs (see :ref:`metrics:Input types`)
- ``'global'``: In this case the ``N`` and ``...`` dimensions of the inputs
(see :ref:`extensions/metrics:input types`)
are flattened into a new ``N_X`` sample axis, i.e. the inputs are treated as if they
were ``(N_X, C)``. From here on the ``average`` parameter applies as usual.
@ -122,7 +123,7 @@ def precision(
is_multiclass:
Used only in certain special cases, where you want to treat inputs as a different type
than what they appear to be. See the parameter's
:ref:`documentation section <metrics:Using the is_multiclass parameter>`
:ref:`documentation section <extensions/metrics:using the is_multiclass parameter>`
for a more detailed explanation and examples.
class_reduction:
@ -224,7 +225,7 @@ def recall(
The reduction method (how the recall scores are aggregated) is controlled by the
``average`` parameter, and additionally by the ``mdmc_average`` parameter in the
multi-dimensional multi-class case. Accepts all inputs listed in :ref:`metrics:Input types`.
multi-dimensional multi-class case. Accepts all inputs listed in :ref:`extensions/metrics:input types`.
Args:
preds: Predictions from model (probabilities, or labels)
@ -255,10 +256,11 @@ def recall(
- ``'samplewise'``: In this case, the statistics are computed separately for each
sample on the ``N`` axis, and then averaged over samples.
The computation for each sample is done by treating the flattened extra axes ``...``
(see :ref:`metrics:Input types`) as the ``N`` dimension within the sample,
(see :ref:`extensions/metrics:input types`) as the ``N`` dimension within the sample,
and computing the metric for the sample based on that.
- ``'global'``: In this case the ``N`` and ``...`` dimensions of the inputs (see :ref:`metrics:Input types`)
- ``'global'``: In this case the ``N`` and ``...`` dimensions of the inputs
(see :ref:`extensions/metrics:input types`)
are flattened into a new ``N_X`` sample axis, i.e. the inputs are treated as if they
were ``(N_X, C)``. From here on the ``average`` parameter applies as usual.
@ -283,7 +285,7 @@ def recall(
is_multiclass:
Used only in certain special cases, where you want to treat inputs as a different type
than what they appear to be. See the parameter's
:ref:`documentation section <metrics:Using the is_multiclass parameter>`
:ref:`documentation section <extensions/metrics:using the is_multiclass parameter>`
for a more detailed explanation and examples.
class_reduction:
@ -371,7 +373,7 @@ def precision_recall(
The reduction method (how the recall scores are aggregated) is controlled by the
``average`` parameter, and additionally by the ``mdmc_average`` parameter in the
multi-dimensional multi-class case. Accepts all inputs listed in :ref:`metrics:Input types`.
multi-dimensional multi-class case. Accepts all inputs listed in :ref:`extensions/metrics:input types`.
Args:
preds: Predictions from model (probabilities, or labels)
@ -402,10 +404,11 @@ def precision_recall(
- ``'samplewise'``: In this case, the statistics are computed separately for each
sample on the ``N`` axis, and then averaged over samples.
The computation for each sample is done by treating the flattened extra axes ``...``
(see :ref:`metrics:Input types`) as the ``N`` dimension within the sample,
(see :ref:`extensions/metrics:input types`) as the ``N`` dimension within the sample,
and computing the metric for the sample based on that.
- ``'global'``: In this case the ``N`` and ``...`` dimensions of the inputs (see :ref:`metrics:Input types`)
- ``'global'``: In this case the ``N`` and ``...`` dimensions of the inputs
(see :ref:`extensions/metrics:input types`)
are flattened into a new ``N_X`` sample axis, i.e. the inputs are treated as if they
were ``(N_X, C)``. From here on the ``average`` parameter applies as usual.
@ -430,7 +433,7 @@ def precision_recall(
is_multiclass:
Used only in certain special cases, where you want to treat inputs as a different type
than what they appear to be. See the parameter's
:ref:`documentation section <metrics:Using the is_multiclass parameter>`
:ref:`documentation section <extensions/metrics:using the is_multiclass parameter>`
for a more detailed explanation and examples.
class_reduction:

Просмотреть файл

@ -151,7 +151,7 @@ def stat_scores(
The reduction method (how the statistics are aggregated) is controlled by the
``reduce`` parameter, and additionally by the ``mdmc_reduce`` parameter in the
multi-dimensional multi-class case. Accepts all inputs listed in :ref:`metrics:Input types`.
multi-dimensional multi-class case. Accepts all inputs listed in :ref:`extensions/metrics:input types`.
Args:
preds: Predictions from model (probabilities or labels)
@ -196,7 +196,7 @@ def stat_scores(
one of the following:
- ``None`` [default]: Should be left unchanged if your data is not multi-dimensional
multi-class (see :ref:`metrics:Input types` for the definition of input types).
multi-class (see :ref:`extensions/metrics:input types` for the definition of input types).
- ``'samplewise'``: In this case, the statistics are computed separately for each
sample on the ``N`` axis, and then the outputs are concatenated together. In each
@ -211,7 +211,7 @@ def stat_scores(
is_multiclass:
Used only in certain special cases, where you want to treat inputs as a different type
than what they appear to be. See the parameter's
:ref:`documentation section <metrics:Using the is_multiclass parameter>`
:ref:`documentation section <extensions/metrics:using the is_multiclass parameter>`
for a more detailed explanation and examples.
Return: