assignment3_coding/starter_code 2/code/policy_network.py
def evaluate(self, env=None, num_episodes=1):
    """
    Evaluates the return for num_episodes episodes.
    Not used right now, all evaluation statistics are computed during training
    episodes.
    """
    if env==None: env = self.env
    paths, rewards = self.sample_path(env, num_episodes)
    avg_reward = np.mean(rewards)
    sigma_reward = np.sqrt(np.var(rewards) / len(rewards))
    msg = "Average reward: {:04.2f} +/- {:04.2f}".format(avg_reward, sigma_reward)
    self.logger.info(msg)
    return avg_reward

    Evaluates the return for num_episodes episodes.
    Not used right now, all evaluation statistics are computed during training
    episodes.
    
Evaluates the return for num_episodes episodes.
Not used right now, all evaluation statistics are computed during training
episodes.
Evaluates the return for num_episodes episodes . Not used right now all evaluation statistics are computed during training episodes .
def evaluate(self, env=None, num_episodes=1):
    if env==None: env = self.env
    paths, rewards = self.sample_path(env, num_episodes)
    avg_reward = np.mean(rewards)
    sigma_reward = np.sqrt(np.var(rewards) / len(rewards))
    msg = "Average reward: {:04.2f} +/- {:04.2f}".format(avg_reward, sigma_reward)
    self.logger.info(msg)
    return avg_reward
def evaluate ( self , env = None , num_episodes = 1 ) : if env == None : env = self . env paths , rewards = self . sample_path ( env , num_episodes ) avg_reward = np . mean ( rewards ) sigma_reward = np . sqrt ( np . var ( rewards ) / len ( rewards ) ) msg = "Average reward: {:04.2f} +/- {:04.2f}" . format ( avg_reward , sigma_reward ) self . logger . info ( msg ) return avg_reward
Evaluates the return for num_episodes episodes.
Evaluates the return for num_episodes episodes .
"""
    Evaluates the return for num_episodes episodes.
    Not used right now, all evaluation statistics are computed during training
    episodes.
    """
self
env
num_episodes