我正在使用gym和stable-baselines3进行强化学习的实验,特别是使用山地车(https://gym.openai.com/envs/MountainCar-v0/)的stable-baselines3的DQN实现
我正在尝试实现一个学习速率调度器,每当强化学习模型的奖励值在给定迭代次数内高于某个阈值时,它就会降低学习速率。我尝试了以下方法:
env = gym.make('MountainCar-v0')
#You can also load other environments like cartpole, MountainCar, Acrobot. Refer to https://gym.openai.com/docs/ for descriptions.
#For example, if you would like to load Cartpole, just replace the above statement with "env = gym.make('CartPole-v1')".
env = stable_baselines3.common.monitor.Monitor(env, log_dir )
callback = EvalCallback(env,log_path = log_dir, deterministic=True) #For evaluating the performance of the agent periodically and logging the results.
policy_kwargs = dict(activation_fn=torch.nn.ReLU,
net_arch=nn_layers, lr_schedule = lr_schedule_custom)
model = DQN("MlpPolicy", env, policy_kwargs = policy_kwargs)
然而,我得到了错误__init__() got multiple values for argument 'lr_schedule'
,尽管文档(https://stable-baselines3.readthedocs.io/en/master/modules/dqn.html)在策略的lr_schedule参数和我在策略中使用的其他参数之间没有任何区别。我该怎么做
非常感谢
目前没有回答
相关问题 更多 >
编程相关推荐