(self, root_folder, experiment_name, hyperparams, iter_nr, info=None)
| 35 | self.apply(lambda x: kaiming_init(x, False, nonlinearity="silu")) |
| 36 | |
| 37 | def save(self, root_folder, experiment_name, hyperparams, iter_nr, info=None): |
| 38 | name=str(iter_nr) |
| 39 | if info is not None: |
| 40 | name+="_"+info |
| 41 | models_path = os.path.join(root_folder, experiment_name, name, "models") |
| 42 | if not os.path.exists(models_path): |
| 43 | os.makedirs(models_path, exist_ok=True) |
| 44 | torch.save(self.state_dict(), os.path.join(models_path, "rgb2material.pt")) |
| 45 | |
| 46 | hyperparams_params_path=os.path.join(models_path, "hyperparams.json") |
| 47 | with open(hyperparams_params_path, 'w', encoding='utf-8') as f: |
| 48 | json.dump(vars(hyperparams), f, ensure_ascii=False, indent=4) |
| 49 | |
| 50 | |
| 51 | def forward(self, batch_dict): |
nothing calls this directly
no test coverage detected