为什么 `ep_rew_mean` 远大于 `evaluate_policy()` 函数评估的奖励

问题描述 投票:0回答:2

我编写了一个自定义的健身房环境,并使用 stable-baselines3 提供的 PPO 进行训练。 Tensorboard记录的

ep_rew_mean
如下:

the ep_rew_mean curve for total 100 million steps, each episode has 50 steps

如图所示,训练后奖励在15.5左右,模型收敛。然而,我对训练模型使用函数

evaluate_policy()
,奖励远小于
ep_rew_mean
值。第一个值是平均奖励,第二个值是奖励标准:

4.349947246664763 1.1806464511030819

我使用函数

evaluate_policy()
的方式是:

mean_reward, std_reward = evaluate_policy(model, env, n_eval_episodes=10000)

根据我的理解,使用

reset()
函数时,初始环境是随机分布在一个区域的,所以不应该出现过拟合的问题。

我也尝试过不同的学习率或者其他参数,这个问题没有解决。

我检查了我的环境,我认为没有错误。

我在网上搜索过,阅读了stable-baselines3的文档和github上的问题,但没有找到解决方案。

reinforcement-learning stable-baselines policy-gradient-descent
2个回答
0
投票
默认情况下,

evaluate_policy
具有
deterministic
True
https://stable-baselines3.readthedocs.io/en/master/common/evaluation.html)。

如果您在训练期间从分布中进行采样,可能有助于评估策略,而无需选择带有

argmax
的操作(通过传入
deterministic=False
)。


0
投票

我也遇到了同样的问题,请问你知道是什么原因造成的吗?

© www.soinside.com 2019 - 2024. All rights reserved.