def begin_fit(self):
    'Prepare state for training'
    (self.lrs, self.iters, self.losses, self.values) = ([], [], [], [])
    names = self.metrics.attrgot('name')
    if (self.train_metrics and self.valid_metrics):
        names = (L('loss') + names)
        names = (names.map('train_{}') + names.map('valid_{}'))
    elif self.valid_metrics:
        names = (L('train_loss', 'valid_loss') + names)
    else:
        names = (L('train_loss') + names)
    if self.add_time:
        names.append('time')
    self.metric_names = ('epoch' + names)
    self.smooth_loss.reset()
Prepare state for training
def begin_fit(self):
    
    (self.lrs, self.iters, self.losses, self.values) = ([], [], [], [])
    names = self.metrics.attrgot('name')
    if (self.train_metrics and self.valid_metrics):
        names = (L('loss') + names)
        names = (names.map('train_{}') + names.map('valid_{}'))
    elif self.valid_metrics:
        names = (L('train_loss', 'valid_loss') + names)
    else:
        names = (L('train_loss') + names)
    if self.add_time:
        names.append('time')
    self.metric_names = ('epoch' + names)
    self.smooth_loss.reset()