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

Added Enveloped Waves to the ObjectiveFunctionFactory #218

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
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,27 @@
)
)
)

objective_function_config_store.add_config_by_name(
config_name="multi_objective_waves_3_params_2_objectives_no_phase_difference",
config_point=Point(
implementation=MultiObjectiveEnvelopedWaves.__name__,
multi_objective_enveloped_waves_config=multi_objective_enveloped_waves_config_store.get_config_by_name("no_phase_difference")
)
)

objective_function_config_store.add_config_by_name(
config_name="multi_objective_waves_3_params_2_objectives_half_pi_phase_difference",
config_point=Point(
implementation=MultiObjectiveEnvelopedWaves.__name__,
multi_objective_enveloped_waves_config=multi_objective_enveloped_waves_config_store.get_config_by_name("half_pi_phase_difference")
)
)

objective_function_config_store.add_config_by_name(
config_name="multi_objective_waves_3_params_2_objectives_pi_phase_difference",
config_point=Point(
implementation=MultiObjectiveEnvelopedWaves.__name__,
multi_objective_enveloped_waves_config=multi_objective_enveloped_waves_config_store.get_config_by_name("pi_phase_difference")
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
from mlos.Spaces import Point
from mlos.OptimizerEvaluationTools.ObjectiveFunctionBase import ObjectiveFunctionBase
from mlos.OptimizerEvaluationTools.ObjectiveFunctionConfigStore import objective_function_config_store
from mlos.OptimizerEvaluationTools.SyntheticFunctions.EnvelopedWaves import EnvelopedWaves
from mlos.OptimizerEvaluationTools.SyntheticFunctions.Flower import Flower
from mlos.OptimizerEvaluationTools.SyntheticFunctions.Hypersphere import Hypersphere
from mlos.OptimizerEvaluationTools.SyntheticFunctions.MultiObjectiveEnvelopedWaves import MultiObjectiveEnvelopedWaves
from mlos.OptimizerEvaluationTools.SyntheticFunctions.MultiObjectiveNestedPolynomialObjective import MultiObjectiveNestedPolynomialObjective
from mlos.OptimizerEvaluationTools.SyntheticFunctions.NestedPolynomialObjective import NestedPolynomialObjective
from mlos.OptimizerEvaluationTools.SyntheticFunctions.PolynomialObjective import PolynomialObjective
from mlos.OptimizerEvaluationTools.SyntheticFunctions.PolynomialObjectiveWrapper import PolynomialObjectiveWrapper
from mlos.OptimizerEvaluationTools.SyntheticFunctions.ThreeLevelQuadratic import ThreeLevelQuadratic
from mlos.Spaces import Point


class ObjectiveFunctionFactory:
Expand Down Expand Up @@ -42,4 +44,10 @@ def create_objective_function(cls, objective_function_config: Point) -> Objectiv
if objective_function_config.implementation == MultiObjectiveNestedPolynomialObjective.__name__:
return MultiObjectiveNestedPolynomialObjective(objective_function_config.multi_objective_nested_polynomial_config)

if objective_function_config.implementation == EnvelopedWaves.__name__:
return EnvelopedWaves(objective_function_config.enveloped_waves_config)

if objective_function_config.implementation == MultiObjectiveEnvelopedWaves.__name__:
return MultiObjectiveEnvelopedWaves(objective_function_config.multi_objective_enveloped_waves_config)

raise ValueError(f"Can't instantiate an objective function with the following implementation: {objective_function_config.implementation}")