21994919156aac15558f77555538346fb702bcbc,autokeras/nn/model_trainer.py,ModelTrainer,train_model,#ModelTrainer#Any#Any#,84

Before Change



        test_metric_value_list = []
        test_loss_list = []
        self.optimizer = torch.optim.Adam(self.model.parameters())

        for epoch in range(max_iter_num):
            self._train()
            test_loss, metric_value = self._test()

After Change



        test_metric_value_list = []
        test_loss_list = []
        self.optimizer = torch.optim.SGD(
            self.model.parameters(),
            0.025,
            momentum=0.9,
            weight_decay=3e-4)
        // self.optimizer = torch.optim.Adam(self.model.parameters())
        self.scheduler = torch.optim.lr_scheduler.CosineAnnealingLR(self.optimizer, max_iter_num)

        for epoch in range(max_iter_num):
            self.scheduler.step()
            self._train()
            test_loss, metric_value = self._test()
            self.current_metric_value = metric_value
            test_metric_value_list.append(metric_value)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: jhfjhfj1/autokeras
Commit Name: 21994919156aac15558f77555538346fb702bcbc
Time: 2018-11-26
Author: jhfjhfj1@gmail.com
File Name: autokeras/nn/model_trainer.py
Class Name: ModelTrainer
Method Name: train_model


Project Name: pyannote/pyannote-audio
Commit Name: c37bbe35ef7e860d2a97a0d464dd24a3fc13c451
Time: 2018-06-29
Author: bredin@limsi.fr
File Name: pyannote/audio/labeling/tasks/base.py
Class Name: LabelingTask
Method Name: fit_iter