(self, metadata)
Update progress bar with batch metrics.
Update progress bar with batch metrics.
Update progress bar with batch metrics .
def on_batch_end(self, metadata):
        """Update progress bar with batch metrics."""
        weights = metadata.get('weights')
        y_batch = metadata.get('y_batch')

        for metric, cal in self.run.metrics.items():
            self.metrics[metric].append(cal(weights, y_batch).mean().item())

        log_dict = {m: np.mean(vals) for m, vals in self.metrics.items()}

        self.bar.update()
        self.bar.set_postfix_str(self.create_custom_postfix_str(log_dict))
def on_batch_end ( self , metadata ) : weights = metadata . get ( 'weights' ) y_batch = metadata . get ( 'y_batch' ) for metric , cal in self . run . metrics . items ( ) : self . metrics [ metric ] . append ( cal ( weights , y_batch ) . mean ( ) . item ( ) ) log_dict = { m : np . mean ( vals ) for m , vals in self . metrics . items ( ) } self . bar . update ( ) self . bar . set_postfix_str ( self . create_custom_postfix_str ( log_dict ) )