Syllabus icon indicating copy to clipboard operation
Syllabus copied to clipboard

Lasertag self play

Open RPegoud opened this issue 11 months ago • 0 comments

New features:

  • Parallel PZ wrapper for Lasertag
  • Selfplay Curriculum
  • PPO training script using selfplay on lasertag
class SelfPlay(Curriculum):
    def __init__(self, agent, device: str, store_agents_on_cpu: bool = False):
        self.store_agents_on_cpu = store_agents_on_cpu
        self.storage_device = "cpu" if self.store_agents_on_cpu else device
        self.agent = deepcopy(agent).to(self.storage_device)

    def update_agent(self, agent):
        self.agent = deepcopy(agent).to(self.storage_device)

    def get_opponent(self):
        # Always return the most recent agent
        return self.agent

    def sample(self, k=1):
        return 0
image

RPegoud avatar Mar 28 '24 09:03 RPegoud