assignment2_coding/starter_code/q2_linear.py
def add_placeholders_op(self):
        """
        Adds placeholders to the graph

        These placeholders are used as inputs to the rest of the model and will be fed
        data during training.
        """
        # this information might be useful
        state_shape = list(self.env.observation_space.shape)

        ##############################################################
        """
        TODO:
            Add placeholders:
            Remember that we stack 4 consecutive frames together.
                - self.s: batch of states, type = uint8
                    shape = (batch_size, img height, img width, nchannels x config.state_history)
                - self.a: batch of actions, type = int32
                    shape = (batch_size)
                - self.r: batch of rewards, type = float32
                    shape = (batch_size)
                - self.sp: batch of next states, type = uint8
                    shape = (batch_size, img height, img width, nchannels x config.state_history)
                - self.done_mask: batch of done, type = bool
                    shape = (batch_size)
                - self.lr: learning rate, type = float32

        (Don't change the variable names!)

        HINT:
            Variables from config are accessible with self.config.variable_name.
            Check the use of None in the dimension for tensorflow placeholders.
            You can also use the state_shape computed above.
        """
        ##############################################################
        ################YOUR CODE HERE (6-15 lines) ##################

        h, w, c = state_shape
        state_history = self.config.state_history
        self.s = tf.placeholder(tf.uint8, (None, h, w, c * state_history))
        self.a = tf.placeholder(tf.int32, (None))
        self.r = tf.placeholder(tf.float32, (None))
        self.sp = tf.placeholder(tf.uint8, (None, h, w, c * state_history))
        self.done_mask = tf.placeholder(tf.bool, (None))
        self.lr = tf.placeholder(tf.float32, (None))

        ##############################################################
        ######################## END YOUR CODE #######################


        Adds placeholders to the graph

        These placeholders are used as inputs to the rest of the model and will be fed
        data during training.
        
Adds placeholders to the graph
These placeholders are used as inputs to the rest of the model and will be fed
data during training.
Adds placeholders to the graph These placeholders are used as inputs to the rest of the model and will be fed data during training .
def add_placeholders_op(self):
        state_shape = list(self.env.observation_space.shape)
        h, w, c = state_shape
        state_history = self.config.state_history
        self.s = tf.placeholder(tf.uint8, (None, h, w, c * state_history))
        self.a = tf.placeholder(tf.int32, (None))
        self.r = tf.placeholder(tf.float32, (None))
        self.sp = tf.placeholder(tf.uint8, (None, h, w, c * state_history))
        self.done_mask = tf.placeholder(tf.bool, (None))
        self.lr = tf.placeholder(tf.float32, (None))
def add_placeholders_op ( self ) : state_shape = list ( self . env . observation_space . shape ) """
        TODO:
            Add placeholders:
            Remember that we stack 4 consecutive frames together.
                - self.s: batch of states, type = uint8
                    shape = (batch_size, img height, img width, nchannels x config.state_history)
                - self.a: batch of actions, type = int32
                    shape = (batch_size)
                - self.r: batch of rewards, type = float32
                    shape = (batch_size)
                - self.sp: batch of next states, type = uint8
                    shape = (batch_size, img height, img width, nchannels x config.state_history)
                - self.done_mask: batch of done, type = bool
                    shape = (batch_size)
                - self.lr: learning rate, type = float32

        (Don't change the variable names!)

        HINT:
            Variables from config are accessible with self.config.variable_name.
            Check the use of None in the dimension for tensorflow placeholders.
            You can also use the state_shape computed above.
        """ h , w , c = state_shape state_history = self . config . state_history self . s = tf . placeholder ( tf . uint8 , ( None , h , w , c * state_history ) ) self . a = tf . placeholder ( tf . int32 , ( None ) ) self . r = tf . placeholder ( tf . float32 , ( None ) ) self . sp = tf . placeholder ( tf . uint8 , ( None , h , w , c * state_history ) ) self . done_mask = tf . placeholder ( tf . bool , ( None ) ) self . lr = tf . placeholder ( tf . float32 , ( None ) )
Adds placeholders to the graph
These placeholders are used as inputs to the rest of the model and will be fed
data during training.
Adds placeholders to the graph These placeholders are used as inputs to the rest of the model and will be fed data during training .
"""
        Adds placeholders to the graph

        These placeholders are used as inputs to the rest of the model and will be fed
        data during training.
        """ # this information might be useful
 ##############################################################
 """
        TODO:
            Add placeholders:
            Remember that we stack 4 consecutive frames together.
                - self.s: batch of states, type = uint8
                    shape = (batch_size, img height, img width, nchannels x config.state_history)
                - self.a: batch of actions, type = int32
                    shape = (batch_size)
                - self.r: batch of rewards, type = float32
                    shape = (batch_size)
                - self.sp: batch of next states, type = uint8
                    shape = (batch_size, img height, img width, nchannels x config.state_history)
                - self.done_mask: batch of done, type = bool
                    shape = (batch_size)
                - self.lr: learning rate, type = float32

        (Don't change the variable names!)

        HINT:
            Variables from config are accessible with self.config.variable_name.
            Check the use of None in the dimension for tensorflow placeholders.
            You can also use the state_shape computed above.
        """ ##############################################################
 ################YOUR CODE HERE (6-15 lines) ##################
 ##############################################################
 ######################## END YOUR CODE #######################

self