(dic)
| 53 | |
| 54 | # Training stats |
| 55 | def 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 |
| 66 | def load_pretrained_model(model, model_path, modules_to_load=None, exclude_modules=None): |
no test coverage detected