当前位置: 首页 > news >正文

Is it possible to modify OpenAI environments?

题意:“是否可以修改 OpenAI 环境?”

问题背景:

There are some things that I would like to modify in the OpenAI environments. If we use the Cartpole example then we can edit things that are in the class init function but with environments that use Box2D it doesn't seem to be as straightforward.

“我有一些想要修改的 OpenAI 环境。如果我们使用 Cartpole 示例,我们可以编辑类的初始化函数中的内容,但对于使用 Box2D 的环境,这似乎就不那么简单了。”

For example, consider the BipedalWalker environment.

“例如,考虑一下 BipedalWalker 环境。”

In this case, how would I edit things like the SPEED_HIP or SPEED_KNEE variables?

“在这种情况下,我该如何编辑像 SPEED_HIP 或 SPEED_KNEE 这样的变量?”

问题解决:

Yes, you can modify or create new environments in gym. The simplest (but not recommended) way is to modify the constants in your local gym installation directly, but of course that's not really nice.

“是的,你可以修改或创建新的 Gym 环境。最简单(但不推荐)的方法是直接修改你本地 Gym 安装中的常量,但这种做法并不优雅。”

A nicer way is to download the bipedal walker environment file (from here) and save it to a file (say, my_bipedal_walker.py)

“更好的方法是下载 Bipedal Walker 环境文件(从这里),并将其保存到一个文件中(比如,`my_bipedal_walker.py`)。”

Then you modify the constants in the my_bipedal_walker.py file, and then just import it in your code (assuming you put the file in a path that is importable, or the same folder as your other code files):

“然后你可以修改 `my_bipedal_walker.py` 文件中的常量,然后在你的代码中导入它(假设你将文件放在一个可以导入的路径中,或与其他代码文件在同一文件夹下)。”

import gym
from my_bipedal_walker import BipedalWalker
env = BipedalWalker()

Then you have the env variable being an instance of the environment, with your defined constants for the physics computation, which you can use with any RL algorithm.

“这样,`env` 变量就会成为环境的一个实例,使用你定义的物理计算常量,你可以将其用于任何强化学习算法。”

An even nicer way would be making your custom environment available in the OpenAI gym registry, which you can do by following the instructions here

“一个更好的方法是将你的自定义环境注册到 OpenAI Gym 注册表中,你可以按照 [这里](链接) 的说明进行操作。”

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • 进程的创建、终止
  • 【安全靶场】-DC-7
  • UE赋予某个C++类tick的能力
  • git错误fatal: Unpack error, check server log
  • 正则表达式备查
  • ubuntu VCS+verdi安装遇到的一些问题
  • 【网络安全】学过编程就是黑客?
  • 持久化SSE对象
  • unity Android + WebGL 浏览器打开
  • 【开源社区】Elasticsearch(ES)中 exists 查询空值字段的坑
  • 【前端】vue监视属性和计算属性对比
  • mp4怎么转换成mp3?看了就会的8种mp4转mp3方法!
  • 快速查找数组中出现奇数次的数字
  • Web应用加密数据传输方案
  • mac安装xmind
  • 《网管员必读——网络组建》(第2版)电子课件下载
  • 【407天】跃迁之路——程序员高效学习方法论探索系列(实验阶段164-2018.03.19)...
  • Angular Elements 及其运作原理
  • CSS3 变换
  • EventListener原理
  • happypack两次报错的问题
  • JSDuck 与 AngularJS 融合技巧
  • Laravel核心解读--Facades
  • MySQL几个简单SQL的优化
  • PAT A1017 优先队列
  • React-flux杂记
  • vue数据传递--我有特殊的实现技巧
  • 不上全站https的网站你们就等着被恶心死吧
  • 跨域
  • 体验javascript之美-第五课 匿名函数自执行和闭包是一回事儿吗?
  • 译自由幺半群
  • elasticsearch-head插件安装
  • 曾刷新两项世界纪录,腾讯优图人脸检测算法 DSFD 正式开源 ...
  • # 利刃出鞘_Tomcat 核心原理解析(八)-- Tomcat 集群
  • #if #elif #endif
  • #Linux(Source Insight安装及工程建立)
  • (3)llvm ir转换过程
  • (AngularJS)Angular 控制器之间通信初探
  • (CVPRW,2024)可学习的提示:遥感领域小样本语义分割
  • (c语言版)滑动窗口 给定一个字符串,只包含字母和数字,按要求找出字符串中的最长(连续)子串的长度
  • (delphi11最新学习资料) Object Pascal 学习笔记---第2章第五节(日期和时间)
  • (floyd+补集) poj 3275
  • (HAL)STM32F103C6T8——软件模拟I2C驱动0.96寸OLED屏幕
  • (安卓)跳转应用市场APP详情页的方式
  • (第二周)效能测试
  • 、写入Shellcode到注册表上线
  • .a文件和.so文件
  • .gitignore文件---让git自动忽略指定文件
  • .NET 常见的偏门问题
  • .NET6 命令行启动及发布单个Exe文件
  • .NET业务框架的构建
  • /usr/bin/perl:bad interpreter:No such file or directory 的解决办法
  • [ 2222 ]http://e.eqxiu.com/s/wJMf15Ku
  • [.net 面向对象程序设计进阶] (19) 异步(Asynchronous) 使用异步创建快速响应和可伸缩性的应用程序...
  • []利用定点式具实现:文件读取,完成不同进制之间的