- PyTorch 1.x Reinforcement Learning Cookbook
- Yuxi (Hayden) Liu
- 181字
- 2021-06-24 12:34:38
How to do it...
There are two ways to install Gym. The first one is to use pip, as follows:
pip install gym
For conda users, remember to install pip first in conda using the following command before installing Gym using pip:
conda install pip
This is because Gym is not officially available in conda as of early 2019.
Another approach is to build from source:
- First, clone the package directly from its Git repository:
git clone https://github.com/openai/gym
- Go to the downloaded folder and install Gym from there:
cd gym
pip install -e .
And now you are good to go. Feel free to play around with gym.
- You can also check the available gym environment by typing the following lines of code:
>>> from gym import envs
>>> print(envs.registry.all())
dict_values([EnvSpec(Copy-v0), EnvSpec(RepeatCopy-v0), EnvSpec(ReversedAddition-v0), EnvSpec(ReversedAddition3-v0), EnvSpec(DuplicatedInput-v0), EnvSpec(Reverse-v0), EnvSpec(CartPole-v0), EnvSpec(CartPole-v1), EnvSpec(MountainCar-v0), EnvSpec(MountainCarContinuous-v0), EnvSpec(Pendulum-v0), EnvSpec(Acrobot-v1), EnvSpec(LunarLander-v2), EnvSpec(LunarLanderContinuous-v2), EnvSpec(BipedalWalker-v2), EnvSpec(BipedalWalkerHardcore-v2), EnvSpec(CarRacing-v0), EnvSpec(Blackjack-v0)
...
...
This will give you a long list of environments if you installed Gym properly. We will play around with some of them in the next recipe, Simulating Atari environments.
推薦閱讀
- Deep Learning Quick Reference
- Hands-On Artificial Intelligence on Amazon Web Services
- Excel 2007函數與公式自學寶典
- Hands-On Cybersecurity with Blockchain
- CorelDRAW X4中文版平面設計50例
- Java Web整合開發全程指南
- Windows游戲程序設計基礎
- 基于32位ColdFire構建嵌入式系統
- ESP8266 Home Automation Projects
- Troubleshooting OpenVPN
- Windows Server 2003系統安全管理
- 網絡安全技術及應用
- Dreamweaver CS6精彩網頁制作與網站建設
- 統計挖掘與機器學習:大數據預測建模和分析技術(原書第3版)
- Cortex-M3嵌入式處理器原理與應用