diff --git a/pytorch_lightning/metrics/regression/explained_variance.py b/pytorch_lightning/metrics/regression/explained_variance.py index 467ac72cc3..fc033fcd16 100644 --- a/pytorch_lightning/metrics/regression/explained_variance.py +++ b/pytorch_lightning/metrics/regression/explained_variance.py @@ -59,6 +59,10 @@ class ExplainedVariance(Metric): process_group: Specify the process group on which synchronization is called. default: None (which selects the entire world) + Raises: + ValueError: + If ``multioutput`` is not one of ``"raw_values"``, ``"uniform_average"`` or ``"variance_weighted"``. + Example: >>> from pytorch_lightning.metrics import ExplainedVariance diff --git a/pytorch_lightning/metrics/regression/psnr.py b/pytorch_lightning/metrics/regression/psnr.py index b07941f010..8a38bf515e 100644 --- a/pytorch_lightning/metrics/regression/psnr.py +++ b/pytorch_lightning/metrics/regression/psnr.py @@ -51,6 +51,10 @@ class PSNR(Metric): process_group: Specify the process group on which synchronization is called. default: None (which selects the entire world) + Raises: + ValueError: + If ``dim`` is not ``None`` and ``data_range`` is not given. + Example: >>> from pytorch_lightning.metrics import PSNR diff --git a/pytorch_lightning/metrics/regression/r2score.py b/pytorch_lightning/metrics/regression/r2score.py index 77f6c1363a..40d9d24711 100644 --- a/pytorch_lightning/metrics/regression/r2score.py +++ b/pytorch_lightning/metrics/regression/r2score.py @@ -66,6 +66,12 @@ class R2Score(Metric): process_group: Specify the process group on which synchronization is called. default: None (which selects the entire world) + Raises: + ValueError: + If ``adjusted`` parameter is not an integer larger or equal to 0. + ValueError: + If ``multioutput`` is not one of ``"raw_values"``, ``"uniform_average"`` or ``"variance_weighted"``. + Example: >>> from pytorch_lightning.metrics import R2Score @@ -102,7 +108,7 @@ class R2Score(Metric): self.num_outputs = num_outputs if adjusted < 0 or not isinstance(adjusted, int): - raise ValueError('`adjusted` parameter should be an integer larger or' ' equal to 0.') + raise ValueError('`adjusted` parameter should be an integer larger or equal to 0.') self.adjusted = adjusted allowed_multioutput = ('raw_values', 'uniform_average', 'variance_weighted')