assignment3_coding/starter_code 2/code/policy_network.py
def normalize_advantage(self, advantages):
    """
    Normalizes the advantage. This function is called only if self.config.normalize_advantage is True.

    Args:
            advantages: the advantages
    Returns:
            adv: Normalized Advantage

    Calculate the advantages, by normalizing the advantages.

    TODO:
    Normalize the advantages so that they have a mean of 0 and standard deviation of 1.
    """
    #######################################################
    #########   YOUR CODE HERE - 1-5 lines.   ############

    advantages = (advantages - np.mean(advantages)) / np.std(advantages)

    #######################################################
    #########          END YOUR CODE.          ############
    return advantages

    Normalizes the advantage. This function is called only if self.config.normalize_advantage is True.

    Args:
            advantages: the advantages
    Returns:
            adv: Normalized Advantage

    Calculate the advantages, by normalizing the advantages.

    TODO:
    Normalize the advantages so that they have a mean of 0 and standard deviation of 1.
    
Normalizes the advantage. This function is called only if self.config.normalize_advantage is True.
Normalizes the advantage . This function is called only if self . config . normalize_advantage is True .
def normalize_advantage(self, advantages):
    advantages = (advantages - np.mean(advantages)) / np.std(advantages)
    return advantages
def normalize_advantage ( self , advantages ) : advantages = ( advantages - np . mean ( advantages ) ) / np . std ( advantages ) return advantages
Normalizes the advantage.
Normalizes the advantage .
"""
    Normalizes the advantage. This function is called only if self.config.normalize_advantage is True.

    Args:
            advantages: the advantages
    Returns:
            adv: Normalized Advantage

    Calculate the advantages, by normalizing the advantages.

    TODO:
    Normalize the advantages so that they have a mean of 0 and standard deviation of 1.
    """ ####################################################### #########   YOUR CODE HERE - 1-5 lines.   ############ ####################################################### #########          END YOUR CODE.          ############
None
adv
self
advantages
None