training_epoch needs to return a "loss" key in the dict
📚 Documentation
Hi everyone!
In the docs detailing the usage of the logging functions training_epoch_end, if "loss": loss is not explicitly passed as a return value, then the code will fail.
The docs at https://pytorch-lightning.readthedocs.io/en/latest/experiment_reporting.html#log-metrics is not correct,
def training_epoch_end(self, outputs):
   loss = some_loss()
   ...

   logs = {'train_loss': loss}
   results = {'log': logs}
   return results
shall be changed to
def training_epoch_end(self, outputs):
   loss = some_loss()
   ...

   logs = {'train_loss': loss}
   results = {'loss': loss, 'log': logs} # <------------------------ Here is the change
   return results
Use case: I want to monitor the training metrics to check whether my network is able to overfit the data (for this functionality, refer to #1076 )