(self, metadata)
Update finished progress bar with latest epoch metrics.
Update finished progress bar with latest epoch metrics.
Update finished progress bar with latest epoch metrics .
def on_epoch_end(self, metadata):
        """Update finished progress bar with latest epoch metrics."""
        epoch = metadata.get('epoch')

        try:
            df = self.run.history.metrics_per_epoch(epoch)
            additional_metrics = {'_'.join(list(map(lambda x: str(x), k))): v for k, v in
                                  df.groupby(['dataloader', 'metric'])['value'].mean().items()}

        except KeyError:
            # no val_dataloaders
            additional_metrics = {}

        old_postfix = self.bar.postfix
        new_postfix = self.create_custom_postfix_str(additional_metrics)

        final_postfix = "{}, {}".format(old_postfix, new_postfix)
        self.bar.set_postfix_str(final_postfix)

        self.bar.refresh()
        self.bar.close()
        del self.bar
def on_epoch_end ( self , metadata ) : epoch = metadata . get ( 'epoch' ) try : df = self . run . history . metrics_per_epoch ( epoch ) additional_metrics = { '_' . join ( list ( map ( lambda x : str ( x ) , k ) ) ) : v for k , v in df . groupby ( [ 'dataloader' , 'metric' ] ) [ 'value' ] . mean ( ) . items ( ) } except KeyError : # no val_dataloaders additional_metrics = { } old_postfix = self . bar . postfix new_postfix = self . create_custom_postfix_str ( additional_metrics ) final_postfix = "{}, {}" . format ( old_postfix , new_postfix ) self . bar . set_postfix_str ( final_postfix ) self . bar . refresh ( ) self . bar . close ( ) del self . bar