Skip to content

Commit

Permalink
Docs: fix code reference links (#2044)
Browse files Browse the repository at this point in the history
* Fix code links in Lightning docs

* Fix class namespace
  • Loading branch information
adamjstewart authored Sep 2, 2023
1 parent b172be9 commit fb84f75
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/source/pages/lightning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.wrappers.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.

0 comments on commit fb84f75

Please sign in to comment.