solver.py 文件源码

python
阅读 38 收藏 0 点赞 0 评论 0

项目:PyFunt 作者: dnlcrl 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号