Deep Learning for Beginners
上QQ阅读APP看书,第一时间看更新

Introduction to Dopamine

An interesting recent development in the world of deep reinforcement learning is Dopamine. Dopamine is a framework for the fast prototyping of deep reinforcement learning algorithms. This book will deal very briefly with reinforcement learning, but you need to know how to install it.

Dopamine is known for being easy to use for new users in the world of reinforcement learning. Also, although it is not an official product of Google, most of its developers are Googlers. In its current state, at the time of writing this book, the framework is very compact and provides ready-to-use algorithms.

To install Dopamine, you can run the following command:

!pip install dopamine-rl

You can test the correct installation of Dopamine by simply executing the following command:

import dopamine

This provides no output, unless there are errors. Usually, Dopamine will make use of a lot of libraries outside of it to allow doing many more interesting things. Right now, some of the most interesting things one can do with reinforcement learning is to train agents with reward policies, which has direct applications in gaming.

As an example, see Figure 2.2, which displays a time snapshot of a video game as it learns, using policies that reinforce desired behavior depending on the actions taken by an agent:

Figure 2.2 - Sample visualization of Dopamine's agent in a reinforcement learning problem in gaming 
An agent in reinforcement learning is the piece that decides what action to take next. The agent accomplishes this by observing the world and the rules of the world. The more defined the rules are, the more constrained the result will be. If the rules are too loose, the agent may not make good decisions on what actions to take.

Although this book does not dive a great deal into reinforcement learning, we will cover an interesting gaming application in the last chapter of the book. For now, you can read the following white paper for more information about Dopamine (Castro, P. S., et.al., 2018).