mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-10 12:21:57 +08:00
Loss keys (#387)
* any key in logs or progress bar is a candidate for callback metric * any key in logs or progress bar is a candidate for callback metric
This commit is contained in:
@@ -318,12 +318,10 @@ The ```dataset_idx``` corresponds to the order of datasets returned in ```val_da
|
||||
``` {.python}
|
||||
def validation_end(self, outputs)
|
||||
```
|
||||
If you didn't define a validation_step, this won't be called.
|
||||
|
||||
Called at the end of the validation loop with the outputs of validation_step.
|
||||
If you didn't define a validation_step, this won't be called. Called at the end of the validation loop with the outputs of validation_step.
|
||||
|
||||
The outputs here are strictly for the progress bar. If you don't need to display anything, don't return anything.
|
||||
|
||||
Any keys present in 'log', 'progress_bar' or the rest of the dictionary are available for callbacks to access.
|
||||
**Params**
|
||||
|
||||
| Param | description |
|
||||
|
||||
@@ -1364,6 +1364,10 @@ class Trainer(TrainerIOMixin):
|
||||
if self.use_dp or self.use_ddp2:
|
||||
loss = reduce_distributed_output(loss, self.num_gpus)
|
||||
|
||||
# use every metric passed in as a candidate for callback
|
||||
callback_metrics.update(progress_bar_metrics)
|
||||
callback_metrics.update(log_metrics)
|
||||
|
||||
return loss, progress_bar_metrics, log_metrics, callback_metrics
|
||||
|
||||
def __clip_gradients(self):
|
||||
|
||||
Reference in New Issue
Block a user