Deep-Reinforcement-Learning-Algorithms-with-PyTorch icon indicating copy to clipboard operation
Deep-Reinforcement-Learning-Algorithms-with-PyTorch copied to clipboard

Implement model saves

Open LucCADORET opened this issue 5 years ago • 2 comments

Hi. Great work on the library, it's working like a charm.

Right now, only the DQN Agent implements the locally_save_policy that allows for saving the current model. Would it be possible to add this feature on other agents also ?

LucCADORET avatar Feb 20 '20 11:02 LucCADORET

I think you can implement that by simply saving all the networks of that specific class [not tested], example:

def locally_save_policy(self):
        """Saves the policy"""
        torch.save(self.nn_local.state_dict(), "Models/{}_local_network.pt".format(self.agent_name))
        torch.save(self.nn_target.state_dict(), "Models/{}_target_network.pt".format(self.agent_name))

I'll have to confirm this.

handaoui-mohamed avatar Mar 02 '20 16:03 handaoui-mohamed

Has there been any updates related to this?

alfred100p avatar Feb 22 '22 21:02 alfred100p