def _broadcast(self, epoch=None):
     record = Report().receive(self.trainer.step_name, self.trainer.worker_id)
     if self.trainer.config.report_on_epoch:
         record.epoch = self.trainer.epochs
     # todo: remove in FinedGrainedSpace
     if self.trainer.config.codec:
         record.desc = self.trainer.config.codec
     if not record.desc:
         record.desc = self.trainer.model_desc
     record.performance = self.trainer.performance
     record.objectives = self.trainer.valid_metrics.objectives
     if record.performance is not None:
         for key in record.performance:
             if key not in record.objectives:
                 if (key == 'flops' or key == 'params'):
                     record.objectives.update({key: 'MIN'})
                 else:
                     record.objectives.update({key: 'MAX'})
     record.model_path = self.trainer.model_path
     record.checkpoint_path = self.trainer.checkpoint_file
     record.weights_file = self.trainer.weights_file
     if self.trainer.runtime is not None:
         record.runtime = self.trainer.runtime
     Report().broadcast(record)
     logging.debug("report_callback record: {}".format(record))
Exemple #2
0
 def _save_best(self, desc):
     record = Report().receive(self.step_name, self.sample_count + 1)
     record.performance = {"accuracy": 100}
     record.desc = desc
     Report().broadcast(record)