O'Reilly logo

Java Deep Learning Projects by Md. Rezaul Karim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Generating the grid

We will be developing a simple game by initializing a grid in exactly the same way each time. The game starts with the agent (A), goal (+), pit (-), and wall (W). All elements are randomly placed on the grid in each game. This is such that the Q-learning just needs to learn how to move the agent from a known starting position to a known goal without hitting the pit, which gives negative rewards. Take a look at this screenshot:

A grid for the GridWorld game showing the elements (that is, agent, goal, pit, and wall)

In short, the target of the game is to reach the goal, where the agent will receive a numerical reward. For ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required