def save_checkpoint(self, file_name='checkpoint.pth.tar', is_best=0):
    state = {'episode': self.current_episode, 'iteration': self.current_iteration, 'state_dict': self.policy_model.state_dict(), 'optimizer': self.optim.state_dict()}
    torch.save(state, (self.config.checkpoint_dir + file_name))
    if is_best:
        shutil.copyfile((self.config.checkpoint_dir + file_name), (self.config.checkpoint_dir + 'model_best.pth.tar'))
def save_checkpoint(self, file_name='checkpoint.pth.tar', is_best=0):
    state = {'episode': self.current_episode, 'iteration': self.current_iteration, 'state_dict': self.policy_model.state_dict(), 'optimizer': self.optim.state_dict()}
    torch.save(state, (self.config.checkpoint_dir + file_name))
    if is_best:
        shutil.copyfile((self.config.checkpoint_dir + file_name), (self.config.checkpoint_dir + 'model_best.pth.tar'))