We proceed with the recipe as follows:
- The first step is importing the necessary modules. This time, besides our usual TensorFlow, Numpy, and Matplotlib, we will be importing Gym and some classes from scikit:
import numpy as npimport tensorflow as tfimport gymimport matplotlib.pyplot as pltfrom sklearn.pipeline import FeatureUnionfrom sklearn.preprocessing import StandardScalerfrom sklearn.kernel_approximation import RBFSampler
- In Q learning, we use NNs as function approximators to estimate the value-function. We define a linear NeuralNetwork class; the NN will take the transformed observation space as input and will predict the estimated Q value. As we have two possible actions, we need two different neural network objects ...