assignment3_coding/starter_code 2/code/baseline_network.py
def add_baseline_op(self, scope = "baseline"):
    """
    Build the baseline network within the scope.

    In this function we will build the baseline network.
    Use build_mlp with the same parameters as the policy network to
    get the baseline estimate. You also have to setup a target
    placeholder and an update operation so the baseline can be trained.

    Args:
        scope: the scope of the baseline network

    TODO: Set the following fields
        self.baseline
            HINT: use build_mlp, the network is the same as policy network
            check self.config for n_layers and layer_size
            HINT: tf.squeeze might be helpful
        self.baseline_target_placeholder --> Not required anymore
        self.update_baseline_op
            HINT: first construct a loss using tf.losses.mean_squared_error.
            HINT: use AdamOptimizer with self.lr

    """
    ######################################################
    #########   YOUR CODE HERE - 4-8 lines.   ############

    self.baseline = build_mlp(self.observation_placeholder,
                              1,
                              scope,
                              self.config.n_layers,
                              self.config.layer_size,
                              self.config.activation)
    loss = tf.losses.mean_squared_error(self.baseline_target_placeholder, tf.squeeze(self.baseline))
    optimizer = tf.train.AdamOptimizer(learning_rate=self.lr)
    self.update_baseline_op = optimizer.minimize(loss)

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

    Build the baseline network within the scope.

    In this function we will build the baseline network.
    Use build_mlp with the same parameters as the policy network to
    get the baseline estimate. You also have to setup a target
    placeholder and an update operation so the baseline can be trained.

    Args:
        scope: the scope of the baseline network

    TODO: Set the following fields
        self.baseline
            HINT: use build_mlp, the network is the same as policy network
            check self.config for n_layers and layer_size
            HINT: tf.squeeze might be helpful
        self.baseline_target_placeholder --> Not required anymore
        self.update_baseline_op
            HINT: first construct a loss using tf.losses.mean_squared_error.
            HINT: use AdamOptimizer with self.lr

    
Build the baseline network within the scope.
In this function we will build the baseline network.
Use build_mlp with the same parameters as the policy network to
get the baseline estimate. You also have to setup a target
placeholder and an update operation so the baseline can be trained.
Build the baseline network within the scope . In this function we will build the baseline network . Use build_mlp with the same parameters as the policy network to get the baseline estimate . You also have to setup a target placeholder and an update operation so the baseline can be trained .
def add_baseline_op(self, scope = "baseline"):
    self.baseline = build_mlp(self.observation_placeholder,
                              1,
                              scope,
                              self.config.n_layers,
                              self.config.layer_size,
                              self.config.activation)
    loss = tf.losses.mean_squared_error(self.baseline_target_placeholder, tf.squeeze(self.baseline))
    optimizer = tf.train.AdamOptimizer(learning_rate=self.lr)
    self.update_baseline_op = optimizer.minimize(loss)
    #
def add_baseline_op ( self , scope = "baseline" ) : self . baseline = build_mlp ( self . observation_placeholder , 1 , scope , self . config . n_layers , self . config . layer_size , self . config . activation ) loss = tf . losses . mean_squared_error ( self . baseline_target_placeholder , tf . squeeze ( self . baseline ) ) optimizer = tf . train . AdamOptimizer ( learning_rate = self . lr ) self . update_baseline_op = optimizer . minimize ( loss )
Build the baseline network within the scope.
Build the baseline network within the scope .
"""
    Build the baseline network within the scope.

    In this function we will build the baseline network.
    Use build_mlp with the same parameters as the policy network to
    get the baseline estimate. You also have to setup a target
    placeholder and an update operation so the baseline can be trained.

    Args:
        scope: the scope of the baseline network

    TODO: Set the following fields
        self.baseline
            HINT: use build_mlp, the network is the same as policy network
            check self.config for n_layers and layer_size
            HINT: tf.squeeze might be helpful
        self.baseline_target_placeholder --> Not required anymore
        self.update_baseline_op
            HINT: first construct a loss using tf.losses.mean_squared_error.
            HINT: use AdamOptimizer with self.lr

    """ ###################################################### #########   YOUR CODE HERE - 4-8 lines.   ############ ####################################################### #########          END YOUR CODE.          ############
self
scope
the scope of the baseline network
the scope of the baseline network