MCPcopy Index your code
hub / github.com/jindongwang/transferlearning / dict_average

Function dict_average

code/ASR/Adapter/utils.py:55–63  ·  view source on GitHub ↗
(dic)

Source from the content-addressed store, hash-verified

53
54# Training stats
55def dict_average(dic):
56 avg_key, avg_val = [], []
57 for key, lst in dic.items():
58 if key.endswith("_lst"):
59 avg_key.append(key[:-4])
60 avg_val.append(np.mean(lst))
61 for key, val in zip(avg_key, avg_val):
62 dic[key] = val
63 return dic
64
65# Load and save
66def load_pretrained_model(model, model_path, modules_to_load=None, exclude_modules=None):

Callers 3

train_epochFunction · 0.90
train_maml_epochFunction · 0.90
testFunction · 0.90

Calls 1

meanMethod · 0.45

Tested by

no test coverage detected