2020-06-16 11:42:56 +00:00
|
|
|
.. testsetup:: *
|
|
|
|
|
2020-06-17 21:44:11 +00:00
|
|
|
import torch
|
2020-06-16 11:42:56 +00:00
|
|
|
from torch.nn import Module
|
|
|
|
from pytorch_lightning.core.lightning import LightningModule
|
|
|
|
from pytorch_lightning.metrics import TensorMetric, NumpyMetric
|
|
|
|
|
|
|
|
Metrics
|
|
|
|
=======
|
|
|
|
This is a general package for PyTorch Metrics. These can also be used with regular non-lightning PyTorch code.
|
|
|
|
Metrics are used to monitor model performance.
|
|
|
|
|
2020-07-08 12:11:40 +00:00
|
|
|
In this package, we provide two major pieces of functionality.
|
2020-06-16 11:42:56 +00:00
|
|
|
|
|
|
|
1. A Metric class you can use to implement metrics with built-in distributed (ddp) support which are device agnostic.
|
2020-07-08 12:11:40 +00:00
|
|
|
2. A collection of ready to use popular metrics. There are two types of metrics: Class metrics and Functional metrics.
|
|
|
|
3. An interface to call `sklearns metrics <https://scikit-learn.org/stable/modules/classes.html#module-sklearn.metrics>`_
|
2020-06-16 11:42:56 +00:00
|
|
|
|
|
|
|
Example::
|
|
|
|
|
|
|
|
from pytorch_lightning.metrics.functional import accuracy
|
|
|
|
|
|
|
|
pred = torch.tensor([0, 1, 2, 3])
|
|
|
|
target = torch.tensor([0, 1, 2, 2])
|
|
|
|
|
|
|
|
# calculates accuracy across all GPUs and all Nodes used in training
|
|
|
|
accuracy(pred, target)
|
|
|
|
|
2020-06-17 11:34:39 +00:00
|
|
|
.. warning::
|
|
|
|
The metrics package is still in development! If we're missing a metric or you find a mistake, please send a PR!
|
2020-07-22 13:58:24 +00:00
|
|
|
to a few metrics. Please feel free to create an issue/PR if you have a proposed metric or have found a bug.
|
2020-06-17 11:34:39 +00:00
|
|
|
|
2020-06-18 21:54:29 +00:00
|
|
|
----------------
|
2020-06-16 11:42:56 +00:00
|
|
|
|
|
|
|
Implement a metric
|
|
|
|
------------------
|
2020-07-08 12:11:40 +00:00
|
|
|
You can implement metrics as either a PyTorch metric or a Numpy metric (It is recommended to use PyTorch metrics when possible,
|
2020-06-17 11:34:39 +00:00
|
|
|
since Numpy metrics slow down training).
|
2020-06-16 11:42:56 +00:00
|
|
|
|
|
|
|
Use :class:`TensorMetric` to implement native PyTorch metrics. This class
|
|
|
|
handles automated DDP syncing and converts all inputs and outputs to tensors.
|
|
|
|
|
|
|
|
Use :class:`NumpyMetric` to implement numpy metrics. This class
|
|
|
|
handles automated DDP syncing and converts all inputs and outputs to tensors.
|
|
|
|
|
|
|
|
.. warning::
|
|
|
|
Numpy metrics might slow down your training substantially,
|
|
|
|
since every metric computation requires a GPU sync to convert tensors to numpy.
|
|
|
|
|
2020-06-18 21:54:29 +00:00
|
|
|
----------------
|
|
|
|
|
2020-06-16 11:42:56 +00:00
|
|
|
TensorMetric
|
|
|
|
^^^^^^^^^^^^
|
|
|
|
Here's an example showing how to implement a TensorMetric
|
|
|
|
|
|
|
|
.. testcode::
|
|
|
|
|
|
|
|
class RMSE(TensorMetric):
|
|
|
|
def forward(self, x, y):
|
|
|
|
return torch.sqrt(torch.mean(torch.pow(x-y, 2.0)))
|
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.metric.TensorMetric
|
|
|
|
:noindex:
|
|
|
|
|
2020-06-18 21:54:29 +00:00
|
|
|
----------------
|
|
|
|
|
2020-06-16 11:42:56 +00:00
|
|
|
NumpyMetric
|
|
|
|
^^^^^^^^^^^
|
|
|
|
Here's an example showing how to implement a NumpyMetric
|
|
|
|
|
|
|
|
.. testcode::
|
|
|
|
|
|
|
|
class RMSE(NumpyMetric):
|
|
|
|
def forward(self, x, y):
|
|
|
|
return np.sqrt(np.mean(np.power(x-y, 2.0)))
|
2020-07-22 13:58:24 +00:00
|
|
|
|
2020-06-16 11:42:56 +00:00
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.metric.NumpyMetric
|
|
|
|
:noindex:
|
|
|
|
|
2020-06-18 21:54:29 +00:00
|
|
|
----------------
|
2020-06-16 11:42:56 +00:00
|
|
|
|
|
|
|
Class Metrics
|
|
|
|
-------------
|
2020-06-17 11:34:39 +00:00
|
|
|
Class metrics can be instantiated as part of a module definition (even with just
|
2020-06-16 11:42:56 +00:00
|
|
|
plain PyTorch).
|
|
|
|
|
|
|
|
.. testcode::
|
|
|
|
|
|
|
|
from pytorch_lightning.metrics import Accuracy
|
|
|
|
|
|
|
|
# Plain PyTorch
|
|
|
|
class MyModule(Module):
|
|
|
|
def __init__(self):
|
|
|
|
super().__init__()
|
|
|
|
self.metric = Accuracy()
|
|
|
|
|
|
|
|
def forward(self, x, y):
|
|
|
|
y_hat = ...
|
|
|
|
acc = self.metric(y_hat, y)
|
|
|
|
|
|
|
|
# PyTorch Lightning
|
|
|
|
class MyModule(LightningModule):
|
|
|
|
def __init__(self):
|
|
|
|
super().__init__()
|
|
|
|
self.metric = Accuracy()
|
|
|
|
|
|
|
|
def training_step(self, batch, batch_idx):
|
|
|
|
x, y = batch
|
|
|
|
y_hat = ...
|
|
|
|
acc = self.metric(y_hat, y)
|
|
|
|
|
|
|
|
These metrics even work when using distributed training:
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
model = MyModule()
|
|
|
|
trainer = Trainer(gpus=8, num_nodes=2)
|
|
|
|
|
|
|
|
# any metric automatically reduces across GPUs (even the ones you implement using Lightning)
|
|
|
|
trainer.fit(model)
|
|
|
|
|
|
|
|
Accuracy
|
|
|
|
^^^^^^^^
|
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.classification.Accuracy
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
AveragePrecision
|
|
|
|
^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.classification.AveragePrecision
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
AUROC
|
|
|
|
^^^^^
|
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.classification.AUROC
|
|
|
|
:noindex:
|
|
|
|
|
2020-07-22 13:58:24 +00:00
|
|
|
BLEUScore
|
|
|
|
^^^^^^^^^
|
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.nlp.BLEUScore
|
|
|
|
:noindex:
|
|
|
|
|
2020-06-16 11:42:56 +00:00
|
|
|
ConfusionMatrix
|
|
|
|
^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.classification.ConfusionMatrix
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
DiceCoefficient
|
|
|
|
^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.classification.DiceCoefficient
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
F1
|
|
|
|
^^
|
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.classification.F1
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
FBeta
|
|
|
|
^^^^^
|
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.classification.FBeta
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
PrecisionRecall
|
|
|
|
^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.classification.PrecisionRecall
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
Precision
|
|
|
|
^^^^^^^^^
|
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.classification.Precision
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
Recall
|
|
|
|
^^^^^^
|
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.classification.Recall
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
ROC
|
|
|
|
^^^
|
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.classification.ROC
|
|
|
|
:noindex:
|
|
|
|
|
2020-06-17 17:44:06 +00:00
|
|
|
MAE
|
|
|
|
^^^
|
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.regression.MAE
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
MSE
|
|
|
|
^^^
|
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.regression.MSE
|
|
|
|
:noindex:
|
|
|
|
|
2020-06-16 11:42:56 +00:00
|
|
|
MulticlassROC
|
|
|
|
^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.classification.MulticlassROC
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
MulticlassPrecisionRecall
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.classification.MulticlassPrecisionRecall
|
|
|
|
:noindex:
|
|
|
|
|
2020-06-18 13:06:31 +00:00
|
|
|
IoU
|
|
|
|
^^^
|
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.classification.IoU
|
|
|
|
:noindex:
|
|
|
|
|
2020-06-17 17:44:06 +00:00
|
|
|
RMSE
|
|
|
|
^^^^
|
|
|
|
|
2020-06-18 21:54:14 +00:00
|
|
|
.. autoclass:: pytorch_lightning.metrics.regression.RMSE
|
2020-06-17 17:44:06 +00:00
|
|
|
:noindex:
|
|
|
|
|
|
|
|
RMSLE
|
|
|
|
^^^^^
|
|
|
|
|
2020-06-18 21:54:14 +00:00
|
|
|
.. autoclass:: pytorch_lightning.metrics.regression.RMSLE
|
2020-06-17 17:44:06 +00:00
|
|
|
:noindex:
|
|
|
|
|
2020-07-23 16:13:52 +00:00
|
|
|
SSIM
|
|
|
|
^^^^
|
|
|
|
|
|
|
|
.. autoclass:: pytorch_lightning.metrics.regression.SSIM
|
|
|
|
:noindex:
|
|
|
|
|
2020-06-18 21:54:29 +00:00
|
|
|
----------------
|
2020-06-16 11:42:56 +00:00
|
|
|
|
|
|
|
Functional Metrics
|
|
|
|
------------------
|
2020-06-17 14:53:48 +00:00
|
|
|
Functional metrics can be called anywhere (even used with just plain PyTorch).
|
|
|
|
|
2020-06-17 21:44:11 +00:00
|
|
|
.. code-block:: python
|
2020-06-17 14:53:48 +00:00
|
|
|
|
|
|
|
from pytorch_lightning.metrics.functional import accuracy
|
|
|
|
|
|
|
|
pred = torch.tensor([0, 1, 2, 3])
|
|
|
|
target = torch.tensor([0, 1, 2, 2])
|
|
|
|
|
|
|
|
# calculates accuracy across all GPUs and all Nodes used in training
|
|
|
|
accuracy(pred, target)
|
|
|
|
|
|
|
|
These metrics even work when using distributed training:
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
class MyModule(...):
|
|
|
|
def forward(self, x, y):
|
|
|
|
return accuracy(x, y)
|
|
|
|
|
|
|
|
model = MyModule()
|
|
|
|
trainer = Trainer(gpus=8, num_nodes=2)
|
|
|
|
|
|
|
|
# any metric automatically reduces across GPUs (even the ones you implement using Lightning)
|
|
|
|
trainer.fit(model)
|
|
|
|
|
2020-06-16 11:42:56 +00:00
|
|
|
|
|
|
|
accuracy (F)
|
|
|
|
^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.accuracy
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
auc (F)
|
|
|
|
^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.auc
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
auroc (F)
|
|
|
|
^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.auroc
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
average_precision (F)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.average_precision
|
|
|
|
:noindex:
|
|
|
|
|
2020-07-22 13:58:24 +00:00
|
|
|
bleu_score (F)
|
|
|
|
^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.bleu_score
|
|
|
|
:noindex:
|
|
|
|
|
2020-06-16 11:42:56 +00:00
|
|
|
confusion_matrix (F)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.confusion_matrix
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
dice_score (F)
|
|
|
|
^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.dice_score
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
f1_score (F)
|
|
|
|
^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.f1_score
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
fbeta_score (F)
|
|
|
|
^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.fbeta_score
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
multiclass_precision_recall_curve (F)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.multiclass_precision_recall_curve
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
multiclass_roc (F)
|
|
|
|
^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.multiclass_roc
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
precision (F)
|
|
|
|
^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.precision
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
precision_recall (F)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.precision_recall
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
precision_recall_curve (F)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.precision_recall_curve
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
recall (F)
|
|
|
|
^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.recall
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
roc (F)
|
|
|
|
^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.roc
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
stat_scores (F)
|
|
|
|
^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.stat_scores
|
|
|
|
:noindex:
|
|
|
|
|
2020-06-18 13:06:31 +00:00
|
|
|
iou (F)
|
|
|
|
^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.iou
|
|
|
|
:noindex:
|
|
|
|
|
2020-07-09 15:54:38 +00:00
|
|
|
mse (F)
|
|
|
|
^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.mse
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
rmse (F)
|
|
|
|
^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.rmse
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
mae (F)
|
|
|
|
^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.mae
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
rmsle (F)
|
|
|
|
^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.rmsle
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
psnr (F)
|
|
|
|
^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.psnr
|
|
|
|
:noindex:
|
|
|
|
|
2020-07-23 16:13:52 +00:00
|
|
|
ssim (F)
|
|
|
|
^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.ssim
|
|
|
|
:noindex:
|
|
|
|
|
2020-06-16 11:42:56 +00:00
|
|
|
stat_scores_multiple_classes (F)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.stat_scores_multiple_classes
|
|
|
|
:noindex:
|
|
|
|
|
2020-06-18 21:54:29 +00:00
|
|
|
----------------
|
2020-06-16 11:42:56 +00:00
|
|
|
|
|
|
|
Metric pre-processing
|
|
|
|
---------------------
|
2020-06-18 13:06:31 +00:00
|
|
|
|
2020-06-16 11:42:56 +00:00
|
|
|
to_categorical (F)
|
|
|
|
^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.to_categorical
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
to_onehot (F)
|
|
|
|
^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.functional.to_onehot
|
|
|
|
:noindex:
|
2020-06-17 11:34:39 +00:00
|
|
|
|
2020-06-18 21:54:29 +00:00
|
|
|
----------------
|
2020-06-17 11:34:39 +00:00
|
|
|
|
|
|
|
Sklearn interface
|
|
|
|
-----------------
|
2020-07-22 13:58:24 +00:00
|
|
|
|
|
|
|
Lightning supports `sklearns metrics module <https://scikit-learn.org/stable/modules/classes.html#module-sklearn.metrics>`_
|
|
|
|
as a backend for calculating metrics. Sklearns metrics are well tested and robust,
|
2020-06-17 11:34:39 +00:00
|
|
|
but requires conversion between pytorch and numpy thus may slow down your computations.
|
|
|
|
|
|
|
|
To use the sklearn backend of metrics simply import as
|
|
|
|
|
|
|
|
.. code-block:: python
|
2020-07-22 13:58:24 +00:00
|
|
|
|
2020-06-17 11:34:39 +00:00
|
|
|
import pytorch_lightning.metrics.sklearns import plm
|
|
|
|
metric = plm.Accuracy(normalize=True)
|
|
|
|
val = metric(pred, target)
|
2020-07-22 13:58:24 +00:00
|
|
|
|
|
|
|
Each converted sklearn metric comes has the same interface as its
|
|
|
|
original counterpart (e.g. accuracy takes the additional `normalize` keyword).
|
|
|
|
Like the native Lightning metrics, these converted sklearn metrics also come
|
2020-06-17 11:34:39 +00:00
|
|
|
with built-in distributed (ddp) support.
|
|
|
|
|
|
|
|
SklearnMetric (sk)
|
|
|
|
^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.SklearnMetric
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
Accuracy (sk)
|
|
|
|
^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.Accuracy
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
AUC (sk)
|
|
|
|
^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.AUC
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
AveragePrecision (sk)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.AveragePrecision
|
|
|
|
:noindex:
|
|
|
|
|
2020-08-05 09:32:53 +00:00
|
|
|
BalancedAccuracy (sk)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.BalancedAccuracy
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
CohenKappaScore (sk)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.CohenKappaScore
|
|
|
|
:noindex:
|
2020-07-22 13:58:24 +00:00
|
|
|
|
2020-06-17 11:34:39 +00:00
|
|
|
ConfusionMatrix (sk)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.ConfusionMatrix
|
|
|
|
:noindex:
|
|
|
|
|
2020-08-05 09:32:53 +00:00
|
|
|
DCG (sk)
|
|
|
|
^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.DCG
|
|
|
|
:noindex:
|
|
|
|
|
2020-06-17 11:34:39 +00:00
|
|
|
F1 (sk)
|
|
|
|
^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.F1
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
FBeta (sk)
|
|
|
|
^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.FBeta
|
|
|
|
:noindex:
|
|
|
|
|
2020-08-05 09:32:53 +00:00
|
|
|
Hamming (sk)
|
|
|
|
^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.Hamming
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
Hinge (sk)
|
|
|
|
^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.Hinge
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
Jaccard (sk)
|
|
|
|
^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.Jaccard
|
|
|
|
:noindex:
|
|
|
|
|
2020-06-17 11:34:39 +00:00
|
|
|
Precision (sk)
|
|
|
|
^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.Precision
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
Recall (sk)
|
|
|
|
^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.Recall
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
PrecisionRecallCurve (sk)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.PrecisionRecallCurve
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
ROC (sk)
|
|
|
|
^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.ROC
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
AUROC (sk)
|
|
|
|
^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.AUROC
|
|
|
|
:noindex:
|
2020-08-05 09:32:53 +00:00
|
|
|
|
|
|
|
ExplainedVariance (sk)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.ExplainedVariance
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
MeanAbsoluteError (sk)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.MeanAbsoluteError
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
MeanSquaredError (sk)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.MeanSquaredError
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
MeanSquaredLogError (sk)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.MeanSquaredLogError
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
MedianAbsoluteError (sk)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.MedianAbsoluteError
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
R2Score (sk)
|
|
|
|
^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.R2Score
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
MeanPoissonDeviance (sk)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.MeanPoissonDeviance
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
MeanGammaDeviance (sk)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.MeanGammaDeviance
|
|
|
|
:noindex:
|
|
|
|
|
|
|
|
MeanTweedieDeviance (sk)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. autofunction:: pytorch_lightning.metrics.sklearns.MeanTweedieDeviance
|
|
|
|
:noindex:
|
|
|
|
|