File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 6
6
7
7
8
8
This tutorial shows how to use PyTorch to train a Deep Q Learning (DQN) agent
9
- on the CartPole-v1 task from the `OpenAI Gym <https://www.gymlibrary.dev/>`__.
9
+ on the CartPole-v0 task from the `OpenAI Gym <https://www.gymlibrary.dev/>`__.
10
10
11
11
**Task**
12
12
46
46
47
47
First, let's import needed packages. Firstly, we need
48
48
`gym <https://github.com/openai/gym>`__ for the environment
49
- (Install using `pip install gym`).
49
+
50
+ .. code-block:: bash
51
+
52
+ %%bash
53
+ pip3 install gym[classic_control]
54
+
50
55
We'll also use the following from PyTorch:
51
56
52
57
- neural networks (``torch.nn``)
74
79
import torchvision .transforms as T
75
80
76
81
77
- env = gym .make ('CartPole-v1 ' , new_step_api = True , render_mode = 'single_rgb_array' ).unwrapped
82
+ env = gym .make ('CartPole-v0 ' , new_step_api = True , render_mode = 'single_rgb_array' ).unwrapped
78
83
79
84
# set up matplotlib
80
85
is_ipython = 'inline' in matplotlib .get_backend ()
You can’t perform that action at this time.
0 commit comments