【问题标题】:How to find distance travelled by 'Humanoid-v2' agent after training?训练后如何查找“Humanoid-v2”代理行进的距离?
【发布时间】:2019-05-12 20:51:58
【问题描述】:

我训练了“Humanoid-v2”(https://github.com/openai/gym/wiki/Humanoid-V1) 走路。训练期间奖励会增加。但是,我还需要一个性能矩阵来告诉我代理走了多远?

此代理 (https://github.com/openai/gym/wiki/Humanoid-V1) 有 376 次观察。 代理的XML文件第27行中提到的位置x、y、z分别对应哪些值https://github.com/openai/gym/blob/master/gym/envs/mujoco/assets/humanoid.xml#L27

谢谢

【问题讨论】:

    标签: xml reinforcement-learning openai-gym


    【解决方案1】:
    • 设初始位置为 (x1,y1,z1),步后位置为 (x2,y2,z2)
    • 代理在一个步骤中经过的距离如下:

    dist=tf.add(tf.squared_difference(x2,x1),tf.squared_difference(y2,y1),tf.squared_difference (z2,z1))

    • 总结记忆中的距离,直到剧集结束

    【讨论】:

    • 感谢您的回答。是的,我能做到。但是,我的问题是在这 376 个观察值中,哪一个对应于 x、y、z 值。
    【解决方案2】:

    根据https://github.com/openai/gym/wiki/Humanoid-V1(我知道是Humanoid-v1,但是状态和动作的定义好像没变),可以用@987654323得到"root" joint的x-velocity和y-velocity @(假设 state 是 376 维状态向量并使用 Python 的索引约定)。

    然后您可以使用例如np.cumsum 来累积速度以获得平移,或聚合速度的范数以获得行进轨迹的长度。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-07-29
      • 2021-10-22
      • 1970-01-01
      • 2020-10-13
      • 1970-01-01
      • 1970-01-01
      • 2012-09-26
      相关资源
      最近更新 更多