Replies: 4 comments 5 replies
-
We could define ModelSystems from them, so you can just grab the entire ModelSystem. This could either be done in the same module (advantage: reading comprehension, the space is defined close to the scoring function), or in a separate module (advantage: more coherent modules, simpler module if you just want the scoring functions). |
Beta Was this translation helpful? Give feedback.
-
I'm starting to think that we may want to build the space, min and max values into the scoring functions. Just to give an example of what I have to do now in order to build several model systems in preparation for benchmarking: # Prepare settings of the peaks model system
peaks_space = [(-3.0, 3.0), (-3.0, 3.0)]
peaks_min = -6.5511
peaks_max = 8.106
peaks_noise = {
"model_type": "constant",
"noise_size": 0.2,
}
# Build ModelSystem object
peaks_model = ModelSystem(
score=peaks,
space=peaks_space,
true_min=peaks_min,
true_max=peaks_max,
noise_model=peaks_noise,
)
# Prepare poly2 system
poly2_space = [(-1.0, 1.0), (-1.0, 1.0)]
poly2_min = -2.051
poly2_max = -1.27
poly2_noise = {
"model_type": "constant",
"noise_size": 0.2,
}
# Build ModelSystem object
poly2_model = ModelSystem(
score=poly2,
space=poly2_space,
true_min=poly2_min,
true_max=poly2_max,
noise_model=poly2_noise,
)
# Prepare Branin Hoo system
branin_space = [(-5.0, 10.0), (0.0, 15.0)]
branin_min = 0.3979
branin_max = -1.27
branin_noise = {
"model_type": "constant",
"noise_size": 0.2,
}
# Build ModelSystem object
branin_model = ModelSystem(
score=branin,
space=branin_space,
true_min=branin_min,
true_max=branin_max,
noise_model=branin_noise,
)
# Gather model systems
model_system_list = [
peaks_model,
poly2_model,
branin_model,
] Having to do this manually gets old really fast, so I think it would make sense to bulk up the benchmark functions to a benchmark class instead, so building the ModelSystem gets down to something like: branin_noise = {
"model_type": "constant",
"noise_size": 0.2,
}
# Build ModelSystem object
branin_model = ModelSystem(
benchmark=branin,
noise_model=branin_noise,
) I guess the practical implementation and interaction with ModelSystem would have the latter check whether a "benchmark" object was passed to it, and if not it should require you to pass a scoring function and a space instead. |
Beta Was this translation helpful? Give feedback.
-
Having score functions and models in separate files would make the individual files more uniform, but it will also make them harder to read, since you have to go to two files to get both the score function and the space. So I prefer having them in the same file. I would suggest some standard naming instead. You used I am not that worried about use in other parts of the package, the IDE should be able to find all of those. But we aren't sure how they are used elsewhere. but maybe I am too cautious? |
Beta Was this translation helpful? Give feedback.
-
Completed in #189 We have chosen to break backward compatibility when importing benchmark systems. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
As it is now, the benchmark functions in ./ProcessOptimizer/model_systems/benchmarks.py have their bounds defined in their docstrings. Is this what we want?
Beta Was this translation helpful? Give feedback.
All reactions