From ee03bce7f06bc026e500287a530726c6768bfa02 Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Thu, 7 Jan 2021 14:01:52 +0100 Subject: [PATCH] fix some minor typos in docs (PL^5369) * fix docs typos * Apply suggestions from code review Co-authored-by: Wansoo Kim * flake8 Co-authored-by: Wansoo Kim (cherry picked from commit a047323cc796dcf5d4709399083bfc4b3b411de9) --- pytorch_lightning/metrics/functional/average_precision.py | 2 +- pytorch_lightning/metrics/functional/explained_variance.py | 2 +- pytorch_lightning/metrics/functional/f_beta.py | 4 ++-- pytorch_lightning/metrics/functional/mean_squared_error.py | 2 +- .../metrics/functional/mean_squared_log_error.py | 2 +- .../metrics/functional/precision_recall_curve.py | 2 +- pytorch_lightning/metrics/functional/psnr.py | 2 -- pytorch_lightning/metrics/functional/r2score.py | 2 +- pytorch_lightning/metrics/functional/roc.py | 2 +- pytorch_lightning/metrics/functional/ssim.py | 2 +- pytorch_lightning/metrics/utils.py | 2 +- 11 files changed, 11 insertions(+), 13 deletions(-) diff --git a/pytorch_lightning/metrics/functional/average_precision.py b/pytorch_lightning/metrics/functional/average_precision.py index da4f37b..20317b8 100644 --- a/pytorch_lightning/metrics/functional/average_precision.py +++ b/pytorch_lightning/metrics/functional/average_precision.py @@ -67,7 +67,7 @@ def average_precision( which for binary problem is translate to 1. For multiclass problems this argument should not be set as we iteratively change it in the range [0,num_classes-1] - sample_weight: sample weights for each data point + sample_weights: sample weights for each data point Returns: tensor with average precision. If multiclass will return list diff --git a/pytorch_lightning/metrics/functional/explained_variance.py b/pytorch_lightning/metrics/functional/explained_variance.py index 20b38c5..2055043 100644 --- a/pytorch_lightning/metrics/functional/explained_variance.py +++ b/pytorch_lightning/metrics/functional/explained_variance.py @@ -62,7 +62,7 @@ def explained_variance( Computes explained variance. Args: - pred: estimated labels + preds: estimated labels target: ground truth labels multioutput: Defines aggregation in the case of multiple output scores. Can be one of the following strings (default is `'uniform_average'`.): diff --git a/pytorch_lightning/metrics/functional/f_beta.py b/pytorch_lightning/metrics/functional/f_beta.py index 2b0ba19..c294d29 100755 --- a/pytorch_lightning/metrics/functional/f_beta.py +++ b/pytorch_lightning/metrics/functional/f_beta.py @@ -75,7 +75,7 @@ def fbeta( If preds has an extra dimension as in the case of multi-class scores we perform an argmax on ``dim=1``. Args: - pred: estimated probabilities + preds: estimated probabilities target: ground-truth labels num_classes: Number of classes in the dataset. beta: Beta coefficient in the F measure. @@ -128,7 +128,7 @@ def f1( If preds has an extra dimension as in the case of multi-class scores we perform an argmax on ``dim=1``. Args: - pred: estimated probabilities + preds: estimated probabilities target: ground-truth labels num_classes: Number of classes in the dataset. threshold: diff --git a/pytorch_lightning/metrics/functional/mean_squared_error.py b/pytorch_lightning/metrics/functional/mean_squared_error.py index e418536..f840753 100644 --- a/pytorch_lightning/metrics/functional/mean_squared_error.py +++ b/pytorch_lightning/metrics/functional/mean_squared_error.py @@ -34,7 +34,7 @@ def mean_squared_error(preds: torch.Tensor, target: torch.Tensor) -> torch.Tenso Computes mean squared error Args: - pred: estimated labels + preds: estimated labels target: ground truth labels Return: diff --git a/pytorch_lightning/metrics/functional/mean_squared_log_error.py b/pytorch_lightning/metrics/functional/mean_squared_log_error.py index 1b96e1a..59012a6 100644 --- a/pytorch_lightning/metrics/functional/mean_squared_log_error.py +++ b/pytorch_lightning/metrics/functional/mean_squared_log_error.py @@ -34,7 +34,7 @@ def mean_squared_log_error(preds: torch.Tensor, target: torch.Tensor) -> torch.T Computes mean squared log error Args: - pred: estimated labels + preds: estimated labels target: ground truth labels Return: diff --git a/pytorch_lightning/metrics/functional/precision_recall_curve.py b/pytorch_lightning/metrics/functional/precision_recall_curve.py index e497c5f..0d562f8 100644 --- a/pytorch_lightning/metrics/functional/precision_recall_curve.py +++ b/pytorch_lightning/metrics/functional/precision_recall_curve.py @@ -173,7 +173,7 @@ def precision_recall_curve( which for binary problem is translate to 1. For multiclass problems this argument should not be set as we iteratively change it in the range [0,num_classes-1] - sample_weight: sample weights for each data point + sample_weights: sample weights for each data point Returns: 3-element tuple containing diff --git a/pytorch_lightning/metrics/functional/psnr.py b/pytorch_lightning/metrics/functional/psnr.py index 4aec3d9..40d3b16 100644 --- a/pytorch_lightning/metrics/functional/psnr.py +++ b/pytorch_lightning/metrics/functional/psnr.py @@ -46,8 +46,6 @@ def psnr( - ``'elementwise_mean'``: takes the mean (default) - ``'sum'``: takes the sum - ``'none'``: no reduction will be applied - return_state: returns a internal state that can be ddp reduced - before doing the final calculation Return: Tensor with PSNR score diff --git a/pytorch_lightning/metrics/functional/r2score.py b/pytorch_lightning/metrics/functional/r2score.py index f689e3a..82117dd 100644 --- a/pytorch_lightning/metrics/functional/r2score.py +++ b/pytorch_lightning/metrics/functional/r2score.py @@ -98,7 +98,7 @@ def r2score( be provided as the ``adjusted`` argument. Args: - pred: estimated labels + preds: estimated labels target: ground truth labels adjusted: number of independent regressors for calculating adjusted r2 score. Default 0 (standard r2 score). diff --git a/pytorch_lightning/metrics/functional/roc.py b/pytorch_lightning/metrics/functional/roc.py index ffd5f9f..26fa6d0 100644 --- a/pytorch_lightning/metrics/functional/roc.py +++ b/pytorch_lightning/metrics/functional/roc.py @@ -98,7 +98,7 @@ def roc( which for binary problem is translate to 1. For multiclass problems this argument should not be set as we iteratively change it in the range [0,num_classes-1] - sample_weight: sample weights for each data point + sample_weights: sample weights for each data point Returns: 3-element tuple containing diff --git a/pytorch_lightning/metrics/functional/ssim.py b/pytorch_lightning/metrics/functional/ssim.py index b527444..a978ce8 100644 --- a/pytorch_lightning/metrics/functional/ssim.py +++ b/pytorch_lightning/metrics/functional/ssim.py @@ -125,7 +125,7 @@ def ssim( Computes Structual Similarity Index Measure Args: - pred: estimated image + preds: estimated image target: ground truth image kernel_size: size of the gaussian kernel (default: (11, 11)) sigma: Standard deviation of the gaussian kernel (default: (1.5, 1.5)) diff --git a/pytorch_lightning/metrics/utils.py b/pytorch_lightning/metrics/utils.py index d79d1a3..e324dad 100644 --- a/pytorch_lightning/metrics/utils.py +++ b/pytorch_lightning/metrics/utils.py @@ -232,7 +232,7 @@ def class_reduce( Args: num: numerator tensor - decom: denominator tensor + denom: denominator tensor weights: weights for each class class_reduction: reduction method for multiclass problems