Esempio n. 1
0
 def __init__(self, model):
     # Window size for smoothing tracked values (with median filtering)
     self.WIN_SZ = int(20 / cfg.NUM_GPUS)
     # Output logging period in SGD iterations
     self.LOG_PERIOD = int(20 /cfg.NUM_GPUS)
     self.smoothed_losses_and_metrics = {
         key: SmoothedValue(self.WIN_SZ)
         for key in model.losses + model.metrics
     }
     self.losses_and_metrics = {
         key: 0
         for key in model.losses + model.metrics
     }
     self.smoothed_total_loss = SmoothedValue(self.WIN_SZ)
     self.smoothed_mb_qsize = SmoothedValue(self.WIN_SZ)
     self.iter_total_loss = np.nan
     self.iter_timer = Timer()
     self.model = model
Esempio n. 2
0
 def __init__(self, model):
     # Window size for smoothing tracked values (with median filtering)
     self.WIN_SZ = 20
     # Output logging period in SGD iterations
     self.LOG_PERIOD = 20
     self.smoothed_losses_and_metrics = {
         key: SmoothedValue(self.WIN_SZ)
         for key in model.losses + model.metrics
     }
     self.losses_and_metrics = {
         key: 0
         for key in model.losses + model.metrics
     }
     self.smoothed_total_loss = SmoothedValue(self.WIN_SZ)
     self.cur_epoch_total_loss = []
     self.last_epoch_mean_loss = 0
     self.smoothed_mb_qsize = SmoothedValue(self.WIN_SZ)
     self.iter_total_loss = np.nan
     self.iter_timer = Timer()
     self.model = model
     self.cur_epoch = 0
    def __init__(self, model, tensorflow_board=None):
        # Window size for smoothing tracked values (with median filtering)
        self.WIN_SZ = 20
        # Output logging period in SGD iterations
        self.LOG_PERIOD = 20
        self.smoothed_losses_and_metrics = {
            key: SmoothedValue(self.WIN_SZ)
            for key in model.losses + model.metrics
        }
        self.losses_and_metrics = {
            key: 0
            for key in model.losses + model.metrics
        }
        self.smoothed_total_loss = SmoothedValue(self.WIN_SZ)
        self.smoothed_mb_qsize = SmoothedValue(self.WIN_SZ)
        self.iter_total_loss = np.nan
        self.iter_timer = Timer()
        self.model = model

        self.tblogger = tensorflow_board
        self.tb_ignored_keys = ['iter', 'eta', 'mb_qsize', 'mem', 'time']