Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Mar 13, 2021
1 parent e29f6e3 commit a5cb115
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/source/pages/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Example:
Similarly it can also reduce the amount of code required to log multiple metrics
inside your LightningModule

.. code-block:: python
.. testcode::

from torchmetrics import Accuracy, MetricCollection, Precision, Recall

Expand All @@ -206,15 +206,15 @@ inside your LightningModule

def training_step(self, batch, batch_idx):
logits = self(x)
...
# ...
output = self.train_metrics(logits, y)
# use log_dict instead of log
# metrics are logged with keys: train_Accuracy, train_Precision and train_Recall
self.log_dict(output)

def validation_step(self, batch, batch_idx):
logits = self(x)
...
# ...
# use log_dict instead of log
# metrics are logged with keys: val_Accuracy, val_Precision and val_Recall
self.log_dict(output)
Expand Down

0 comments on commit a5cb115

Please sign in to comment.