(dic)
| 24 | |
| 25 | # Training stats |
| 26 | def 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 |
| 37 | def load_pretrained_model(model, model_path, modules_to_load=None, exclude_modules=None): |
no test coverage detected