MCPcopy Create free account
hub / github.com/M-Nauta/ProtoTree / save

Method save

prototree/prototree.py:273–279  ·  view source on GitHub ↗
(self, directory_path: str)

Source from the content-addressed store, hash-verified

271 return self._root.num_leaves
272
273 def save(self, directory_path: str):
274 # Make sure the target directory exists
275 if not os.path.isdir(directory_path):
276 os.mkdir(directory_path)
277 # Save the model to the target directory
278 with open(directory_path + '/model.pth', 'wb') as f:
279 torch.save(self, f)
280
281 def save_state(self, directory_path: str):
282 # Make sure the target directory exists

Callers 10

run_treeFunction · 0.95
cub.pyFile · 0.80
upsampleFunction · 0.80
save_stateMethod · 0.80
save_treeFunction · 0.80
save_best_train_treeFunction · 0.80
save_best_test_treeFunction · 0.80
save_tree_descriptionFunction · 0.80
gen_pred_visFunction · 0.80
_gen_dot_nodesFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected