def save(self, path):
savedir = smartutils.create_folder(pjoin(path, type(self).__name__))
hyperparameters = {'version': 2,
'image_shape': self.image_shape,
'nb_channels': self.nb_channels,
'ordering_seed': self.ordering_seed,
'use_mask_as_input': self.use_mask_as_input,
'hidden_activation': self.hidden_activation,
'has_convnet': self.has_convnet,
'has_fullnet': self.has_fullnet}
smartutils.save_dict_to_json_file(pjoin(savedir, "meta.json"), {"name": self.__class__.__name__})
smartutils.save_dict_to_json_file(pjoin(savedir, "hyperparams.json"), hyperparameters)
# Save residual parameters for the projection shortcuts.
np.savez(pjoin(savedir, "params.npz"), *self.parameters)
评论列表
文章目录