MCPcopy
hub / github.com/jindongwang/transferlearning / dict_average

Function dict_average

code/ASR/CMatch/utils.py:26–34  ·  view source on GitHub ↗
(dic)

Source from the content-addressed store, hash-verified

24
25# Training stats
26def dict_average(dic):
27 avg_key, avg_val = [], []
28 for key, lst in dic.items():
29 if key.endswith("_lst"):
30 avg_key.append(key[:-4])
31 avg_val.append(np.mean(lst))
32 for key, val in zip(avg_key, avg_val):
33 dic[key] = val
34 return dic
35
36# Load and save
37def load_pretrained_model(model, model_path, modules_to_load=None, exclude_modules=None):

Callers 3

testFunction · 0.90
train_epochFunction · 0.90
train_uda_epochFunction · 0.90

Calls 1

meanMethod · 0.45

Tested by

no test coverage detected