[IDEA] Support for simulators and surrogates in the problem format #155
Labels
desdeo2paper
Issues that need to be resolved before a papaer describing DESDEO 2.0 can be submitted.
enhancement
restructuring
Label for the DESDEO restructuring project
What is the current behavior?
The current problem format does not support simulators and surrogates.
Describe the solution you'd like
The problem format should be updated to support simulators and surrogates.
The problem JSON should be updated to store extra information about simulators and surrogates. This can be done by adding
the following fields to the problem JSON, specifically in the objectives array, and a new top-level key called simulators:
Note that a single simulator or surrogate can return multiple objective function values. In such cases, the simulator_file Path
or the surrogate Paths are repeated for all such objectives.
None of the current parsers will support simulators. A new evaluator must be created that can call the polars parser for
analytic objectives. This evaluator will call the simulator file with the following command (just an example):
python_interpreter
is discovered during runtime.file_name
is stored in the problem JSON (problem.objectives.simulator_file).decision_vars
come from the solver. The parameters are set by the analyst while initializing the evaluator.Finally, while initializing the evaluator, the analyst can also choose to load pre-trained surrogate models from disk.
The evaluator must provide the following methods:
What is the motivation/use case for changing the behavior?
The current problem format does not support simulators and surrogates. This feature is essential for many real-world optimization problems.
Describe alternatives you've considered
See Issue [IDEA] Connecting DESDEO to external software, like simulators #85.
Additional context
At least initially, the
Evaluator
class does not need to support all three cases (analytical, simulator, and surrogate).Start with supporting only the simulator case. Then add support for the surrogate case. Note that the simulator and surrogate
cases are mutually exclusive (and exhaustive if there are no analytical objectives). For the forseeable future, there is
no need to support analytical objectives in this evaluator. However, if it is trivial to use the current polars evaluator
to add support for analytical objectives, then go ahead and do it.
The simulator file should have the following requirements:
-d
followed by a json string of the decision variables. The json string should be a list of lists. Each inner list should contain the decision variables for a single sample. The length of the inner list should be equal to the number of decision variables.-p
followed by a json string of the parameters. The json string should be a dictionary of parameters that are not decision variables but affect the results. The keys should be the names of the parameters and the values should be the values of the parameters. The parameters should be set by the analyst while initializing the evaluator.problem.simulators.parameters
is also present in the problem JSON file.As this involves a lot of boilerplate code, a few templates should be provided in the documentation. The only relevant
template for this issue is a template for connecting a simulator that exists as a binary on the local machine.
In the future, more templates can be added for connecting simulators that are hosted on the cloud, etc. For now, focus on supporting just a single simulator file.
As for the surrogates, for now, the analyst is responsible for training the surrogate models and saving them to disk.
For this issue, focus on supporting just sklearn models with a certain file format. Though this needs to be expanded in the future.
The text was updated successfully, but these errors were encountered: