Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pymoo version #2145

Merged
merged 3 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion nncf/experimental/torch/nas/bootstrapNAS/search/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@
ValFnType = Callable[[TModel, DataLoaderType], float]


class FixIntegerRandomSampling(IntegerRandomSampling):
"""
Wrapper for the IntegerRandomSampling with the fix for https://github.com/anyoptimization/pymoo/issues/388.
"""

def _do(self, problem, n_samples, **kwargs):
n, (xl, xu) = problem.n_var, problem.bounds()
return np.column_stack([np.random.randint(xl[k], xu[k] + 1, size=(n_samples)) for k in range(n)])


class EvolutionaryAlgorithms(Enum):
NSGA2 = "NSGA2"

Expand Down Expand Up @@ -207,7 +217,7 @@ def __init__(
if evo_algo == EvolutionaryAlgorithms.NSGA2.value:
self._algorithm = NSGA2(
pop_size=self.search_params.population,
sampling=IntegerRandomSampling(),
sampling=FixIntegerRandomSampling(),
crossover=SBX(
prob=self.search_params.crossover_prob,
eta=self.search_params.crossover_eta,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def find_version(*file_paths):
"pandas>=1.1.5,<2.1",
"psutil",
"pydot>=1.4.1",
"pymoo @ git+https://github.com/anyoptimization/pymoo.git@695cb26923903f872c7256a9013609769f3cc2bd",
"pymoo>=0.6.0.1",
# The recent pyparsing major version update seems to break
# integration with networkx - the graphs parsed from current .dot
# reference files no longer match against the graphs produced in tests.
Expand Down