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

Network construction and training

As I stated, we will create a DQN network using MultiLayerNetwork and the MultiLayerConfiguration configuration of DL4J, which will serve as our Q-function. Therefore, the first step is to create a MultiLayerNetwork by defining MultiLayerConfiguration. Since the state has 64 elements—4 x 4 x 4our network has to have an input layer of 64 units, two hidden layers of 164 and 150 units each, and an output layer of 4, for four possible actions (up, down, left, and right). This is outlined here:

The structure of the DQN network, showing an input layer, two hidden layers, and an output layer

Nevertheless, we will ...

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