evolution-strategies-starter icon indicating copy to clipboard operation
evolution-strategies-starter copied to clipboard

Doesn't the gradient need to be rescaled with σ ?

Open pzdkn opened this issue 2 years ago • 4 comments

According to the paper on page 3, Algorithm 2, the gradient in line 11 is rescaled by the standard deviation. However I can't see it in the code in: https://github.com/openai/evolution-strategies-starter/blob/master/es_distributed/es.py#L247

What is the rationale behind this ? That it is included into the LR ?

pzdkn avatar Aug 31 '21 13:08 pzdkn

Seems like it, brax does the same.

qwfy avatar Oct 05 '21 13:10 qwfy

I see, I guess it doesn't matter much as it is just a constant scaling. Still, without the scaling, the estimator would be biased.

pzdkn avatar Oct 07 '21 10:10 pzdkn

🤝 I also noticed this issue today. Without dividing $\sigma$, the gradient estimation is around 100x smaller in magnitude (since sigma is usually at 0.01 magnitude). That explains why in the example configuration, the “stepsize: 0.01” is relatively larger. I am curious about the rationale as well.

zxymark221 avatar Oct 23 '21 22:10 zxymark221

@zxymark221 , I guess in the end it just gets absorbed into the learning rate, since sigma is constant. However, I think the gradient won't be an unbiased estimate anymore.

pzdkn avatar Nov 01 '21 19:11 pzdkn