assignment3_coding/starter_code 2/code/policy_network.py
def calculate_advantage(self, returns, observations):
    """
    Calculates the advantage for each of the observations
    Args:
      returns: the returns
      observations: the observations
    Returns:
      advantage: the advantage
    """
    if self.config.use_baseline:
      # override the behavior of advantage by subtracting baseline
      advantages = self.baseline_network.calculate_advantage(returns, observations)
    else:
      advantages = returns

    if self.config.normalize_advantage:
      advantages = self.normalize_advantage(advantages)

    return advantages

    Calculates the advantage for each of the observations
    Args:
      returns: the returns
      observations: the observations
    Returns:
      advantage: the advantage
    
Calculates the advantage for each of the observations
Calculates the advantage for each of the observations
def calculate_advantage(self, returns, observations):
    if self.config.use_baseline:
      advantages = self.baseline_network.calculate_advantage(returns, observations)
    else:
      advantages = returns
    if self.config.normalize_advantage:
      advantages = self.normalize_advantage(advantages)
    return advantages
def calculate_advantage ( self , returns , observations ) : if self . config . use_baseline : advantages = self . baseline_network . calculate_advantage ( returns , observations ) else : advantages = returns if self . config . normalize_advantage : advantages = self . normalize_advantage ( advantages ) return advantages
Calculates the advantage for each of the observations
Calculates the advantage for each of the observations
"""
    Calculates the advantage for each of the observations
    Args:
      returns: the returns
      observations: the observations
    Returns:
      advantage: the advantage
    """ # override the behavior of advantage by subtracting baseline
None
advantage
self
returns
None
observations
None