Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
"metadata": {},
"outputs": [],
"source": [
"Q = np.ones((width,height,len(actions)),dtype=np.float)*1.0/len(actions)"
"Q = np.ones((width,height,len(actions)),dtype=np.float64)*1.0/len(actions)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion 8-Reinforcement/1-QLearning/solution/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
"metadata": {},
"outputs": [],
"source": [
"Q = np.ones((width,height,len(actions)),dtype=np.float)*1.0/len(actions)"
"Q = np.ones((width,height,len(actions)),dtype=np.float64)*1.0/len(actions)"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions 8-Reinforcement/2-Gym/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ In this lesson, we will be using a library called **OpenAI Gym** to simulate dif

## OpenAI Gym

In the previous lesson, the rules of the game and the state were given by the `Board` class which we defined ourselves. Here we will use a special **simulation environment**, which will simulate the physics behind the balancing pole. One of the most popular simulation environments for training reinforcement learning algorithms is called a [Gym](https://gym.openai.com/), which is maintained by [OpenAI](https://openai.com/). By using this gym we can create difference **environments** from a cartpole simulation to Atari games.
In the previous lesson, the rules of the game and the state were given by the `Board` class which we defined ourselves. Here we will use a special **simulation environment**, which will simulate the physics behind the balancing pole. One of the most popular simulation environments for training reinforcement learning algorithms is called a [Gym](https://gymnasium.farama.org/), which is maintained by [OpenAI](https://openai.com/). By using this gym we can create difference **environments** from a cartpole simulation to Atari games.

> **Note**: You can see other environments available from OpenAI Gym [here](https://gym.openai.com/envs/#classic_control).
> **Note**: You can see other environments available from OpenAI Gym [here](https://gymnasium.farama.org/environments/classic_control/).

First, let's install the gym and import required libraries (code block 1):

Expand Down
4 changes: 2 additions & 2 deletions 8-Reinforcement/2-Gym/assignment.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Train Mountain Car

[OpenAI Gym](http://gym.openai.com) has been designed in such a way that all environments provide the same API - i.e. the same methods `reset`, `step` and `render`, and the same abstractions of **action space** and **observation space**. Thus is should be possible to adapt the same reinforcement learning algorithms to different environments with minimal code changes.
[OpenAI Gym](https://gymnasium.farama.org) has been designed in such a way that all environments provide the same API - i.e. the same methods `reset`, `step` and `render`, and the same abstractions of **action space** and **observation space**. Thus is should be possible to adapt the same reinforcement learning algorithms to different environments with minimal code changes.

## A Mountain Car Environment

[Mountain Car environment](https://gym.openai.com/envs/MountainCar-v0/) contains a car stuck in a valley:
[Mountain Car environment](https://gymnasium.farama.org/environments/classic_control/mountain_car/) contains a car stuck in a valley:

<img src="images/mountaincar.png" width="300"/>

Expand Down
2 changes: 1 addition & 1 deletion 8-Reinforcement/2-Gym/solution/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
"outputs": [],
"source": [
"def discretize(x):\n",
" return tuple((x/np.array([0.25, 0.25, 0.01, 0.1])).astype(np.int))"
" return tuple((x/np.array([0.25, 0.25, 0.01, 0.1])).astype(np.int_))"
]
},
{
Expand Down