def on_train_begin(self, logs={}):
    self.liveplot.set_metrics([metric for metric in self.params['metrics'] if (not metric.startswith('val_'))])
    if isinstance(self.model.loss, list):
        losses = self.model.loss
    elif isinstance(self.model.loss, dict):
        losses = list(self.model.loss.values())
    else:
        losses = [self.model.loss]
    metric2printable_updated = metric2printable.copy()
    loss_name = loss2name(losses[0])
    metric2printable_updated['loss'] = '{} (cost function)'.format(metric2printable_updated.get(loss_name, loss_name))
    if (len(losses) > 1):
        for (output_name, loss) in zip(self.model.output_names, losses):
            loss_name = loss2name(loss)
            metric2printable_updated['{}_loss'.format(output_name)] = '{} ({})'.format(metric2printable_updated.get(loss_name, loss_name), output_name)
    else:
        for output_name in self.model.output_names:
            metric2printable_updated['{}_loss'.format(output_name)] = '{} ({})'.format(metric2printable_updated.get(loss_name, loss_name), output_name)
    self.liveplot.metric2title = metric2printable_updated
    self.liveplot.set_max_epoch(self.params['epochs'])
def on_train_begin(self, logs={}):
    self.liveplot.set_metrics([metric for metric in self.params['metrics'] if (not metric.startswith('val_'))])
    if isinstance(self.model.loss, list):
        losses = self.model.loss
    elif isinstance(self.model.loss, dict):
        losses = list(self.model.loss.values())
    else:
        losses = [self.model.loss]
    metric2printable_updated = metric2printable.copy()
    loss_name = loss2name(losses[0])
    metric2printable_updated['loss'] = '{} (cost function)'.format(metric2printable_updated.get(loss_name, loss_name))
    if (len(losses) > 1):
        for (output_name, loss) in zip(self.model.output_names, losses):
            loss_name = loss2name(loss)
            metric2printable_updated['{}_loss'.format(output_name)] = '{} ({})'.format(metric2printable_updated.get(loss_name, loss_name), output_name)
    else:
        for output_name in self.model.output_names:
            metric2printable_updated['{}_loss'.format(output_name)] = '{} ({})'.format(metric2printable_updated.get(loss_name, loss_name), output_name)
    self.liveplot.metric2title = metric2printable_updated
    self.liveplot.set_max_epoch(self.params['epochs'])