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 4—our 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:
Nevertheless, we will ...