Pytorch-lightning: Is 'update_tng_log_metrics' working?

Created on 24 Sep 2019  路  1Comment  路  Source: PyTorchLightning/pytorch-lightning

Hi, all!
Does lightning call update_tng_log_metrics function right before it logs metric for the batch as described in the docs ?

I wanted loss (in training steps) to be displayed as loss/train in tensorboard.
To do so, I planned to use update_tng_log_metrics and copy logs['loss'] to logs['loss/train'], and there I noticed that the function may not called.

Code

Here is my code.

class myLightningModule(pl.LightningModule):
   # REQUIRED functions

    def training_step(self, batch, batch_nb):
        inputs, targets = batch
        outputs = self.forward(inputs)
        return {'loss':self.loss_func(outputs, targets)}

    def update_tng_log_metrics(self, logs):
        logs['loss/train'] = logs['loss']
        return logs

What have you tried?

To look into logs, I tried dump logs inside update_tng_log_metrics function by print it. I didn't got any output, not even a None.

question

Most helpful comment

Old docs... has been cleaned up.

To modify metrics use:
self.experiment.whatever_you_want_to_do

>All comments

Old docs... has been cleaned up.

To modify metrics use:
self.experiment.whatever_you_want_to_do

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iakremnev picture iakremnev  路  3Comments

anthonytec2 picture anthonytec2  路  3Comments

chuong98 picture chuong98  路  3Comments

remisphere picture remisphere  路  3Comments

srush picture srush  路  3Comments