def from_checkpoint(cls, checkpoint):
        '''
        Restore the model from a checkpoint
        
        Args:
            checkpoint (dict): the checkpoint attributes generated by checkpoint_attributes()
        '''
        print("\nINFO - Restoring model from checkpoint...")
        agent = cls(
            anticipatory_param=checkpoint['anticipatory_param'],
            batch_size=checkpoint['batch_size'],
            min_buffer_size_to_learn=checkpoint['min_buffer_size_to_learn'],
            num_actions=checkpoint['num_actions'],
            sl_learning_rate=checkpoint['sl_learning_rate'],
            train_every=checkpoint['train_every'],
            evaluate_with=checkpoint['evaluate_with'],
            device=checkpoint['device'],
            q_mlp_layers=checkpoint['rl_agent']['q_estimator']['mlp_layers'],
            state_shape=checkpoint['rl_agent']['q_estimator']['state_shape'],
            hidden_layers_sizes=[],
        )
        
        agent.policy_network = AveragePolicyNetwork.from_checkpoint(checkpoint['policy_network'])
        agent._reservoir_buffer = ReservoirBuffer.from_checkpoint(checkpoint['reservoir_buffer'])
        agent._mode = checkpoint['mode']
        agent.total_t = checkpoint['total_t']
        agent.train_t = checkpoint['train_t']
        agent.policy_network.to(agent.device)
        agent.policy_network.eval()
        agent.policy_network_optimizer = torch.optim.Adam(agent.policy_network.parameters(), lr=agent._sl_learning_rate)
        agent.policy_network_optimizer.load_state_dict(checkpoint['policy_network_optimizer'])
        agent._rl_agent.from_checkpoint(checkpoint['rl_agent'])
        agent._rl_agent.set_device(agent.device)
        return agent

        Restore the model from a checkpoint
        
        Args:
            checkpoint (dict): the checkpoint attributes generated by checkpoint_attributes()
        
rlcard/agents/nfsp_agent.py