MCPcopy Create free account
hub / github.com/modelscope/modelscope / update

Method update

modelscope/trainers/utils/log_buffer.py:25–32  ·  view source on GitHub ↗
(self, vars: dict, count: int = 1)

Source from the content-addressed store, hash-verified

23 self.ready = False
24
25 def update(self, vars: dict, count: int = 1) -> None:
26 assert isinstance(vars, dict)
27 for key, var in vars.items():
28 if key not in self.val_history:
29 self.val_history[key] = []
30 self.n_history[key] = []
31 self.val_history[key].append(var)
32 self.n_history[key].append(count)
33
34 def average(self, n: int = 0) -> None:
35 """Average latest n values or all values."""

Callers 15

_key_chain_to_hookFunction · 0.45
parse_cliMethod · 0.45
build_datasetMethod · 0.45
to_parallelMethod · 0.45
train_stepMethod · 0.45
get_eval_data_loaderMethod · 0.45
single_gpu_testFunction · 0.45
multi_gpu_testFunction · 0.45
get_metric_valuesFunction · 0.45
train_stepMethod · 0.45
trainMethod · 0.45

Calls 2

itemsMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected