Skip to content

Commit

Permalink
filtering failures (#203)
Browse files Browse the repository at this point in the history
filtering failures before finding next configuration in search
  • Loading branch information
Sande33p committed Jul 31, 2023
1 parent 3ddcf6f commit 98854c6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion deephyper/search/nas/_regevo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import collections
import numbers

from deephyper.search.nas._base import NeuralArchitectureSearch

Expand Down Expand Up @@ -105,7 +106,8 @@ def _search(self, max_evals, timeout):
self._evaluator.submit(self._gen_random_batch(size=num_received))

def _select_parent(self, sample: list) -> list:
cfg, _ = max(sample, key=lambda x: x[1])
filtered_sample = [s for s in sample if isinstance(s[1], numbers.Number)]
cfg, _ = max(filtered_sample, key=lambda x: x[1])
return cfg["arch_seq"]

def _gen_random_batch(self, size: int) -> list:
Expand Down

0 comments on commit 98854c6

Please sign in to comment.