Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: normalize_reward not subtracting mean #348

Closed
ChenDRAG opened this issue Mar 10, 2021 · 1 comment
Closed

Question: normalize_reward not subtracting mean #348

ChenDRAG opened this issue Mar 10, 2021 · 1 comment
Labels
question Further information is requested

Comments

@ChenDRAG
Copy link

def normalize_reward(self, reward: np.ndarray) -> np.ndarray:

    def normalize_reward(self, reward: np.ndarray) -> np.ndarray:
        """
        Normalize rewards using this VecNormalize's rewards statistics.
        Calling this method does not update statistics.
        """
        if self.norm_reward:
            reward = np.clip(reward / np.sqrt(self.ret_rms.var + self.epsilon), -self.clip_reward, self.clip_reward)
        return reward

I wonder why we do not subtract mean in normalize reward? I have done some experiment and it indeed shows that "subtract mean" will reduce performance, but chould you tell me why exactly. Are there researches or explanations validing this thought?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants