dqn.py
def _build_network(self, h_size=16, l_rate=0.001) -> None:
        """DQN Network architecture (simple MLP)

        Args:
            h_size (int, optional): Hidden layer dimension
            l_rate (float, optional): Learning rate
        """
        with tf.variable_scope(self.net_name):
            self._X = tf.placeholder(tf.float32, [None, self.input_size], name="input_x")
            net = self._X

            net = tf.layers.dense(net, h_size, activation=tf.nn.relu)
            net = tf.layers.dense(net, self.output_size)
            self._Qpred = net

            self._Y = tf.placeholder(tf.float32, shape=[None, self.output_size])
            self._loss = tf.losses.mean_squared_error(self._Y, self._Qpred)

            optimizer = tf.train.AdamOptimizer(learning_rate=l_rate)
            self._train = optimizer.minimize(self._loss)
DQN Network architecture (simple MLP)

        Args:
            h_size (int, optional): Hidden layer dimension
            l_rate (float, optional): Learning rate
        
DQN Network architecture (simple MLP)
DQN Network architecture ( simple MLP )
def _build_network(self, h_size=16, l_rate=0.001) -> None:
        with tf.variable_scope(self.net_name):
            self._X = tf.placeholder(tf.float32, [None, self.input_size], name="input_x")
            net = self._X
            net = tf.layers.dense(net, h_size, activation=tf.nn.relu)
            net = tf.layers.dense(net, self.output_size)
            self._Qpred = net
            self._Y = tf.placeholder(tf.float32, shape=[None, self.output_size])
            self._loss = tf.losses.mean_squared_error(self._Y, self._Qpred)
            optimizer = tf.train.AdamOptimizer(learning_rate=l_rate)
            self._train = optimizer.minimize(self._loss)
def _build_network ( self , h_size = 16 , l_rate = 0.001 ) -> None : with tf . variable_scope ( self . net_name ) : self . _X = tf . placeholder ( tf . float32 , [ None , self . input_size ] , name = "input_x" ) net = self . _X net = tf . layers . dense ( net , h_size , activation = tf . nn . relu ) net = tf . layers . dense ( net , self . output_size ) self . _Qpred = net self . _Y = tf . placeholder ( tf . float32 , shape = [ None , self . output_size ] ) self . _loss = tf . losses . mean_squared_error ( self . _Y , self . _Qpred ) optimizer = tf . train . AdamOptimizer ( learning_rate = l_rate ) self . _train = optimizer . minimize ( self . _loss )
DQN Network architecture (simple MLP)
DQN Network architecture ( simple MLP )
"""DQN Network architecture (simple MLP)

        Args:
            h_size (int, optional): Hidden layer dimension
            l_rate (float, optional): Learning rate
        """
self
h_size
Hidden layer dimension
Hidden layer dimension
l_rate
None