ElegantRL icon indicating copy to clipboard operation
ElegantRL copied to clipboard

DQN

Open guest-oo opened this issue 1 year ago • 1 comments

请问 我使用helloworld——DQN文件训练完成后 如何保存训练完成的神经网络参数以及在测试中对其进行使用。以及我应该如何设置自己想要的环境而不是gym现成的环境。

guest-oo avatar Apr 03 '24 12:04 guest-oo

In HelloWorld, it will save model during training and evaluation by using torch.save(actor.state_dict(), save_path). You can load it by using model.load_state_dict(torch.load(save_path)).

You may create your own environment class which can be inherited from gym.Env, and write your own step(), reset() and so on. Then you can use your env class and env_args to train the model.

stellawang196 avatar Jun 01 '24 00:06 stellawang196