From b7f4d6f84c0e84c742a5dafd742b4f913e8eb671 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Fri, 1 Sep 2023 20:55:23 -0400 Subject: [PATCH] Fix code links in Lightning docs --- docs/source/pages/lightning.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/pages/lightning.rst b/docs/source/pages/lightning.rst index f9cab16e285..d5362f4f85c 100644 --- a/docs/source/pages/lightning.rst +++ b/docs/source/pages/lightning.rst @@ -206,7 +206,7 @@ The following contains a list of pitfalls to be aware of: self.accuracy(preds, y) # compute metrics self.log('train_acc_step', self.accuracy) # log metric object -* Using `~torchmetrics.MetricTracker` wrapper with Lightning is a special case, because the wrapper in itself is not a metric - i.e. it does not inherit from the base `~torchmetrics.Metric` class but instead from `~torch.nn.ModuleList`. Thus, - to log the output of this metric one needs to manually log the returned values (not the object) using `self.log` - and for epoch level logging this should be done in the appropriate `on_***_epoch_end` method. +* Using :class:`~torchmetrics.MetricTracker` wrapper with Lightning is a special case, because the wrapper in itself is not a metric + i.e. it does not inherit from the base :class:`~torchmetrics.Metric` class but instead from :class:`~torch.nn.ModuleList`. Thus, + to log the output of this metric one needs to manually log the returned values (not the object) using ``self.log`` + and for epoch level logging this should be done in the appropriate ``on_***_epoch_end`` method.