stable-baselines3 icon indicating copy to clipboard operation
stable-baselines3 copied to clipboard

proposed fix for RunningMeanStd overflow

Open spiglerg opened this issue 8 months ago • 0 comments

Connected to Issue https://github.com/DLR-RM/stable-baselines3/issues/1953

Description

RunningMeanStd is made robust to overflows with two modifications:

  • the product that can produce overflows when `count' becomes too large is split into a product of smaller quantities;
  • overflow exceptions are detected, and in that case normalization counts are rescaled, and the function is called again.

Motivation and Context

  • Issue https://github.com/DLR-RM/stable-baselines3/issues/1953

  • Closes #1953

  • [x] I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

  • [x] Bug fix (non-breaking change which fixes an issue)

Checklist

  • [x] I've read the CONTRIBUTION guide (required)
  • [ ] I have updated the tests accordingly (required for a bug fix or a new feature).
  • [x] I have reformatted the code using make format (required)
  • [x] I have checked the codestyle using make check-codestyle and make lint (required)
  • [x] I have ensured make pytest and make type both pass. (required)
  • [x] I have checked that the documentation builds using make doc (required)

spiglerg avatar Jun 29 '24 10:06 spiglerg