Gradient-Free-Optimizers
Gradient-Free-Optimizers copied to clipboard
Sporadic "out of bounds"-error in smbo for very large search-spaces
There appears to be a bug in the initial sampler of the sequence-model-based optimization algorithms that only occurs in the "test_large_search_space.py"-tests. This is the error:
gradient_free_optimizers/search.py:96: in search
self.search_step(nth_trial)
gradient_free_optimizers/search.py:185: in search_step
self.finish_initialization()
gradient_free_optimizers/optimizers/global_opt/lipschitz_optimization.py:59: in finish_initialization
self.all_pos_comb = self._all_possible_pos()
gradient_free_optimizers/optimizers/smb_opt/smbo.py:112: in _all_possible_pos
if self.conv.not_in_constraint(pos):
gradient_free_optimizers/optimizers/core_optimizer/converter.py:59: in not_in_constraint
para = self.value2para(self.position2value(position))
gradient_free_optimizers/optimizers/core_optimizer/converter.py:72: in wrapper
return func_(self, *args)
@returnNoneIfArgNone
def position2value(self, position: Optional[list]) -> Optional[list]:
value = []
for n, space_dim in enumerate(self.search_space_values):
> value.append(space_dim[position[n]])
E IndexError: index 201 is out of bounds for axis 0 with size 100
gradient_free_optimizers/optimizers/core_optimizer/converter.py:81: IndexError
For some reason this error started to appear after switching from python 3.8 to 3.10 on my local machine.
It is strange, that this error never occurred in the CI. And I have no idea, why this was no problem in python 3.8, since the methgrid-method (which is important for the position generation in the algorithm) has not changed its behaviour (as far as I can tell).