facebookresearch / salina

a Lightweight library for sequential learning agents, including reinforcement learning
MIT License
426 stars 41 forks source link

Bug in NRemoteAgent? #19

Closed neighthan closed 2 years ago

neighthan commented 2 years ago

NRemoteAgent's create method has the signature def create(agent, num_processes=0, time_size=None, **extra_args):. Should this be def create(self, agent, num_processes=0, time_size=None, **extra_args):? Right now, it seems the agent is making copies of itself to put in remote processes instead of making copies of an agent that's passed to create.

https://github.com/facebookresearch/salina/blob/f231c77e44e87713d54984fa08ef4b38be47f644/salina/agents/remote.py#L193

ludc commented 2 years ago

No, the create function is a static function that you use like this: agent = MyAgent() remote_agent,remote_workspace=NRemoteAgent.create(agent,.....)