-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle invalid neighbors in local search gracefully (#773)
* Catch ValueError raised by neighborhood iterator If the iterator returned by `ConfigSpace.util.get_one_exchange_neighborhood` reaches an invalid configuration, it raises a `ValueError` with the probability 5 %. The randomness is sampled using `np.random.random()`, so it is non-deterministic. See ConfigSpace/util.pyx:218. This commit ensures that the exception is caught and handled gracefully. * Consider only valid configurations in local search In local search, only advance to a better-scoring neighbor if that neighbor is a valid configuration. Note that `neighborhood_iterator` may yield an invalid configuration.
- Loading branch information
1 parent
7cd6a98
commit 45daebb
Showing
2 changed files
with
29 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters