Skip to content

Commit

Permalink
Fix code links in Lightning docs
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjstewart committed Sep 2, 2023
1 parent b172be9 commit b7f4d6f
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.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 b7f4d6f

Please sign in to comment.