Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
extra_meters = collections.defaultdict(lambda: AverageMeter())
valid_subsets = args.valid_subset.split(',')
extra_meters = collections.defaultdict(lambda: AverageMeter())
valid_subsets = args.valid_subset.split(',')
extra_meters = collections.defaultdict(lambda: AverageMeter())
valid_subsets = args.valid_subset.split(',')
extra_meters = defaultdict(lambda: AverageMeter())
for sample in progress:
def init_meters(self, args):
self.meters = OrderedDict()
self.meters['train_loss'] = AverageMeter()
self.meters['train_nll_loss'] = AverageMeter()
self.meters['valid_loss'] = AverageMeter()
self.meters['valid_nll_loss'] = AverageMeter()
self.meters['wps'] = TimeMeter() # words per second
self.meters['ups'] = TimeMeter() # updates per second
self.meters['wpb'] = AverageMeter() # words per batch
self.meters['bsz'] = AverageMeter() # sentences per batch
self.meters['gnorm'] = AverageMeter() # gradient norm
self.meters['clip'] = AverageMeter() # % of updates clipped
self.meters['oom'] = AverageMeter() # out of memory
if args.fp16:
self.meters['loss_scale'] = AverageMeter() # dynamic loss scale
self.meters['wall'] = TimeMeter() # wall time in seconds
self.meters['train_wall'] = StopwatchMeter() # train wall time in seconds
extra_meters = collections.defaultdict(lambda: AverageMeter())
def init_meters(self, args):
self.meters = OrderedDict()
self.meters["train_loss"] = AverageMeter()
self.meters["train_nll_loss"] = AverageMeter()
self.meters["valid_loss"] = AverageMeter()
self.meters["valid_nll_loss"] = AverageMeter()
self.meters["wps"] = TimeMeter() # words per second
self.meters["ups"] = TimeMeter() # updates per second
self.meters["wpb"] = AverageMeter() # words per batch
self.meters["bsz"] = AverageMeter() # sentences per batch
self.meters["gnorm"] = AverageMeter() # gradient norm
self.meters["clip"] = AverageMeter() # % of updates clipped
self.meters["oom"] = AverageMeter() # out of memory
if args.fp16:
self.meters["loss_scale"] = AverageMeter() # dynamic loss scale
self.meters["wall"] = TimeMeter() # wall time in seconds
self.meters["train_wall"] = StopwatchMeter() # train wall time in seconds
extra_meters = collections.defaultdict(lambda: AverageMeter())
extra_meters = collections.defaultdict(lambda: AverageMeter())
extra_meters = collections.defaultdict(lambda: AverageMeter())
max_update = args.max_update or math.inf