(self)
Helper method to initialize the tf networks used
Helper method to initialize the tf networks used
Helper method to initialize the tf networks used
def init_network(self):
        """ Helper method to initialize the tf networks used """
        tf_map_generator = self._hyperparams['network_model']
        tf_map, fc_vars, last_conv_vars = tf_map_generator(dim_input=self._dO, dim_output=self._dU, batch_size=self.batch_size,
                                  network_config=self._hyperparams['network_params'])
        self.obs_tensor = tf_map.get_input_tensor()
        self.precision_tensor = tf_map.get_precision_tensor()
        self.action_tensor = tf_map.get_target_output_tensor()
        self.act_op = tf_map.get_output_op()
        self.feat_op = tf_map.get_feature_op()
        self.loss_scalar = tf_map.get_loss_op()
        self.fc_vars = fc_vars
        self.last_conv_vars = last_conv_vars

        # Setup the gradients
        self.grads = [tf.gradients(self.act_op[:,u], self.obs_tensor)[0]
                for u in range(self._dU)]
def init_network ( self ) : tf_map_generator = self . _hyperparams [ 'network_model' ] tf_map , fc_vars , last_conv_vars = tf_map_generator ( dim_input = self . _dO , dim_output = self . _dU , batch_size = self . batch_size , network_config = self . _hyperparams [ 'network_params' ] ) self . obs_tensor = tf_map . get_input_tensor ( ) self . precision_tensor = tf_map . get_precision_tensor ( ) self . action_tensor = tf_map . get_target_output_tensor ( ) self . act_op = tf_map . get_output_op ( ) self . feat_op = tf_map . get_feature_op ( ) self . loss_scalar = tf_map . get_loss_op ( ) self . fc_vars = fc_vars self . last_conv_vars = last_conv_vars # Setup the gradients self . grads = [ tf . gradients ( self . act_op [ : , u ] , self . obs_tensor ) [ 0 ] for u in range ( self . _dU ) ]