MCPcopy Index your code
hub / github.com/OpenGVLab/InternVL / update

Method update

classification/utils.py:398–408  ·  view source on GitHub ↗
(self, val)

Source from the content-addressed store, hash-verified

396 self.var = 0
397
398 def update(self, val):
399 self.val = val
400 self.avg = 0
401 self.var = 0
402 if not math.isnan(val) and not math.isinf(val):
403 self.val_list.append(val)
404 if self.max_len > 0 and len(self.val_list) > self.max_len:
405 self.val_list = self.val_list[-self.max_len:]
406 if len(self.val_list) > 0:
407 self.avg = np.mean(np.array(self.val_list))
408 self.var = np.std(np.array(self.val_list))

Callers 15

train_epochFunction · 0.95
train_one_epochFunction · 0.95
get_vocabMethod · 0.80
calculate_score.pyFile · 0.80
construct_promptFunction · 0.80
main_eval_only.pyFile · 0.80
__init__Method · 0.80
__call__Method · 0.80
eval_epochFunction · 0.80
validate_realFunction · 0.80
validateFunction · 0.80

Calls

no outgoing calls

Tested by 1

mainFunction · 0.64