4e97ea190ad48674052e4cf5343617d17c219f73,allennlp/training/trainer.py,Trainer,_metrics_to_console,#Trainer#Any#Any#,292

Before Change


        else:
            message_template = "Training %s : %3f "

        for name, value in train_metrics.items():
            if val_metrics:
                logger.info(message_template, name, value, name, val_metrics[name])
            else:
                logger.info(message_template, name, value)

    def _update_learning_rate(self, epoch: int, val_metric: float = None) -> None:
        if not self._learning_rate_scheduler:
            return

After Change


        dual_message_template = "Training %s : %3f    Validation %s : %3f "
        message_template = "%s %s : %3f "

        metric_names = set(train_metrics.keys())
        if val_metrics:
            metric_names.update(val_metrics.keys())

        for name in metric_names:
            train_metric = train_metrics.get(name)
            val_metric = val_metrics.get(name)

            if val_metric is not None and train_metric is not None:
                logger.info(dual_message_template, name, train_metric, name, val_metric)
            elif val_metric is not None:
                logger.info(message_template, "Validation", name, val_metric)
            elif train_metric is not None:
                logger.info(message_template, "Training", name, train_metric)

    def _update_learning_rate(self, epoch: int, val_metric: float = None) -> None:
        if not self._learning_rate_scheduler:
            return
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: allenai/allennlp
Commit Name: 4e97ea190ad48674052e4cf5343617d17c219f73
Time: 2018-01-22
Author: markn@allenai.org
File Name: allennlp/training/trainer.py
Class Name: Trainer
Method Name: _metrics_to_console


Project Name: allenai/allennlp
Commit Name: 4e97ea190ad48674052e4cf5343617d17c219f73
Time: 2018-01-22
Author: markn@allenai.org
File Name: allennlp/training/trainer.py
Class Name: Trainer
Method Name: _metrics_to_tensorboard


Project Name: allenai/allennlp
Commit Name: 4e9802ed633e4d682fbf95e424c4f0bce0802c7f
Time: 2017-08-16
Author: mattg@allenai.org
File Name: allennlp/nn/initializers.py
Class Name: InitializerApplicator
Method Name: from_params