Here we start short series called “Reinforcement Learning in practice”! AI playing games.
We will go through few challenges - focused on games from Openai Gym - and see what kind of results we can get.
First one - is simplest one - Frozen Lake game.
- Frozen Lake
- Lunar Lander
All the details explained HERE but shortly…
Game looks like that:
Seriously … ;)
It is simple text game - where we start at position S, our goal is to move to position marked with G (goal) and we have to avoid H (holes).
We receive 1 point for reach G, 0 points otherwise.
Good results were accomplished with tabular methods - in particular classical Bellman equation. We used our favourite library - Pytorch.
Rewards (scores received from environment):
Info: X axis is number of episodes, Y axis is score (rewards received from environment per episode).
Steps (how fast agent reached the goal):
Info: X axis is number of episodes, Y axis is number of steps executed by agent
In both cases we can see that, after short period of learning, our agent figured out optimal path and kept using it after that - maximizing possible results.
Finally the game was solved consistently with 6 steps (best possible result) and of course rewards reached maximum 1 point.
Below - agent’s performance captured on video:
Like it? Want to do similar things?
Have a look at our course! We teach everything from scratch!