algorithms/common_funcs_scm.py
def weigh_and_add_curiosity_reward(policy, sample_batch):
    """Compute curiosity of this agent and add to rewards.
    """
    cur_curiosity_reward_weight = policy.compute_curiosity_reward_weight()
    # Align the reward, as the reward for timestep n is calculated at timestep n+1.
    curiosity_reward = np.concatenate((sample_batch[SOCIAL_CURIOSITY_REWARD][1:], [0]))

    # Clip curiosity reward
    reward = np.clip(curiosity_reward, -policy.curiosity_reward_clip, policy.curiosity_reward_clip)
    reward = reward * cur_curiosity_reward_weight

    # Add to trajectory
    sample_batch[SOCIAL_CURIOSITY_REWARD] = reward
    sample_batch["rewards"] = sample_batch["rewards"] + reward

    return sample_batch
Compute curiosity of this agent and add to rewards.
    
Compute curiosity of this agent and add to rewards.
Compute curiosity of this agent and add to rewards .
def weigh_and_add_curiosity_reward(policy, sample_batch):
    cur_curiosity_reward_weight = policy.compute_curiosity_reward_weight()
    curiosity_reward = np.concatenate((sample_batch[SOCIAL_CURIOSITY_REWARD][1:], [0]))
    reward = np.clip(curiosity_reward, -policy.curiosity_reward_clip, policy.curiosity_reward_clip)
    reward = reward * cur_curiosity_reward_weight
    sample_batch[SOCIAL_CURIOSITY_REWARD] = reward
    sample_batch["rewards"] = sample_batch["rewards"] + reward
    return sample_batch
def weigh_and_add_curiosity_reward ( policy , sample_batch ) : cur_curiosity_reward_weight = policy . compute_curiosity_reward_weight ( ) curiosity_reward = np . concatenate ( ( sample_batch [ SOCIAL_CURIOSITY_REWARD ] [ 1 : ] , [ 0 ] ) ) reward = np . clip ( curiosity_reward , - policy . curiosity_reward_clip , policy . curiosity_reward_clip ) reward = reward * cur_curiosity_reward_weight sample_batch [ SOCIAL_CURIOSITY_REWARD ] = reward sample_batch [ "rewards" ] = sample_batch [ "rewards" ] + reward return sample_batch
Compute curiosity of this agent and add to rewards.
Compute curiosity of this agent and add to rewards .
"""Compute curiosity of this agent and add to rewards.
    """ # Align the reward, as the reward for timestep n is calculated at timestep n+1. # Clip curiosity reward # Add to trajectory
policy
sample_batch