Use shorter range for seeded random-state

This commit is contained in:
hroff-1902 2019-12-14 15:17:45 +03:00 committed by GitHub
parent 82ff878e38
commit f2266ea9f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -477,7 +477,7 @@ class Hyperopt:
return trials return trials
def _set_random_state(self, random_state: Optional[int]) -> int: def _set_random_state(self, random_state: Optional[int]) -> int:
return random_state or random.randint(1, 2**32 - 1) return random_state or random.randint(1, 2**16 - 1)
def start(self) -> None: def start(self) -> None:
self.random_state = self._set_random_state(self.config.get('hyperopt_random_state', None)) self.random_state = self._set_random_state(self.config.get('hyperopt_random_state', None))