MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / save

Method save

models/strand_codec.py:401–412  ·  view source on GitHub ↗
(self, root_folder, experiment_name, hyperparams, iter_nr, info=None)

Source from the content-addressed store, hash-verified

399
400
401 def save(self, root_folder, experiment_name, hyperparams, iter_nr, info=None):
402 name=str(iter_nr)
403 if info is not None:
404 name+="_"+info
405 models_path = os.path.join(root_folder, experiment_name, name, "models")
406 if not os.path.exists(models_path):
407 os.makedirs(models_path, exist_ok=True)
408 torch.save(self.state_dict(), os.path.join(models_path, "strand_codec.pt"))
409
410 hyperparams_params_path=os.path.join(models_path, "hyperparams.json")
411 with open(hyperparams_params_path, 'w', encoding='utf-8') as f:
412 json.dump(vars(hyperparams), f, ensure_ascii=False, indent=4)
413
414
415 def forward(self, gt_dict, hyperparams, normalization_dict):

Callers 6

trainFunction · 0.45
trainFunction · 0.45
saveFunction · 0.45
phase_endedMethod · 0.45
generate_latents_dinov2Function · 0.45
generate_scalp_texturesFunction · 0.45

Calls 1

state_dictMethod · 0.45

Tested by

no test coverage detected