def make_check_point(self):
'''
Save the solver's current status
'''
checkpoints = {
'model': self.model,
'epoch': self.epoch,
'best_params': self.best_params,
'best_val_acc': self.best_val_acc,
'loss_history': self.loss_history,
'val_acc_history': self.val_acc_history,
'train_acc_history': self.train_acc_history}
name = 'check_' + str(self.epoch)
directory = os.path.join(self.path_checkpoints, name)
if not os.path.exists(directory):
os.makedirs(directory)
try:
np.save(checkpoints, os.path.join(
directory, name + '.pkl'))
except:
print('sorry, I haven\'t fixed this line, but it should be easy to fix, if you want you can try now and make a pull request')
raise()
评论列表
文章目录