Skip to content

Commit d5c9a99

Browse files
authored
Objfun/nasengb (#235)
* rm * refactor(bnnbo): rename to nasengb
1 parent 635691d commit d5c9a99

10 files changed

Lines changed: 1028 additions & 7 deletions

carps/build/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,23 @@ benchmark_hpob:
155155
$(PIP) install -r ../container/recipes/benchmarks/HPOB/HPOB_requirements.txt
156156
. ../container/recipes/benchmarks/HPOB/download_data.sh
157157

158+
benchmark_nasengb:
159+
@if [ ! -d "lib/naseng_benchmark" ]; then \
160+
git clone https://github.com/luh-ai/naseng_benchmark.git lib/naseng_benchmark; \
161+
else \
162+
echo "lib/naseng_benchmark already exists, skipping clone and just pull" && git pull; \
163+
fi
164+
$(PIP) install -e lib/naseng_benchmark
165+
$(PIP) install py-pde torchvision swig gymnasium[box2d]
166+
158167
benchmarks:
159168
$(MAKE) benchmark_bbob
160169
$(MAKE) benchmark_yahpo
161170
$(MAKE) benchmark_pymoo
162171
$(MAKE) benchmark_mfpbench
163172
$(MAKE) benchmark_hpobench
164173
$(MAKE) benchmark_hpob
174+
$(MAKE) benchmark_nasengb
165175

166176
optimizers:
167177
$(MAKE) optimizer_smac

carps/configs/task/generate_tasks.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,7 +1802,7 @@
18021802
"cell_type": "markdown",
18031803
"metadata": {},
18041804
"source": [
1805-
"# BoTorch / BNN-BO"
1805+
"# BoTorch / nasengb"
18061806
]
18071807
},
18081808
{
@@ -1840,7 +1840,7 @@
18401840
")\n",
18411841
"from hydra.utils import instantiate\n",
18421842
"from omegaconf import DictConfig, OmegaConf\n",
1843-
"from bnnbo_test_functions import (\n",
1843+
"from naseng_benchmark import (\n",
18441844
" BnnDraw,\n",
18451845
" KnowledgeDistillation,\n",
18461846
" LunarLanderProblem,\n",
@@ -1863,7 +1863,7 @@
18631863
"def get_n_trials(dimension: int) -> int:\n",
18641864
" return int(np.ceil(20 + 40 * np.sqrt(dimension)))\n",
18651865
"\n",
1866-
"def generate_bnnbo_configs(\n",
1866+
"def generate_nasengb_configs(\n",
18671867
" problem_classes: list[BaseTestProblem],\n",
18681868
" get_n_trials_fn: Callable[[int], int],\n",
18691869
" target_path: Path,\n",
@@ -1924,7 +1924,7 @@
19241924
" search_space_has_priors=False\n",
19251925
" )\n",
19261926
" cfg = DictConfig({\n",
1927-
" \"benchmark_id\": task_base_id.upper(),\n",
1927+
" \"benchmark_id\": task_base_id,\n",
19281928
" \"task_id\": \"${task.name}\",\n",
19291929
" \"task\": {\n",
19301930
" \"_target_\": \"carps.utils.task.Task\",\n",
@@ -1962,7 +1962,7 @@
19621962
" WeldedBeamSO,\n",
19631963
" TensionCompressionString\n",
19641964
"]\n",
1965-
"generate_bnnbo_configs(problem_classes, get_n_trials, base_path / \"BNNBO\", \"bnnbo\")"
1965+
"generate_nasengb_configs(problem_classes, get_n_trials, base_path / \"nasengb\", \"nasengb\")"
19661966
]
19671967
},
19681968
{
@@ -1987,7 +1987,7 @@
19871987
],
19881988
"metadata": {
19891989
"kernelspec": {
1990-
"display_name": ".env",
1990+
"display_name": ".venv",
19911991
"language": "python",
19921992
"name": "python3"
19931993
},
@@ -2001,7 +2001,7 @@
20012001
"name": "python",
20022002
"nbconvert_exporter": "python",
20032003
"pygments_lexer": "ipython3",
2004-
"version": "3.12.9"
2004+
"version": "3.13.2"
20052005
},
20062006
"pycharm": {
20072007
"stem_cell": {
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# @package _global_
2+
benchmark_id: nasengb
3+
task_id: ${task.name}
4+
task:
5+
_target_: carps.utils.task.Task
6+
name: nasengb/BoreholeMultiFidelity
7+
seed: ${seed}
8+
objective_function:
9+
_target_: carps.objective_functions.botorch.BOTorchObjectiveFunction
10+
botorch_problem:
11+
_target_: botorch.test_functions.multi_fidelity.BoreholeMultiFidelity
12+
seed: ${seed}
13+
input_space:
14+
_target_: carps.utils.task.InputSpace
15+
configuration_space:
16+
_target_: ConfigSpace.configuration_space.ConfigurationSpace.from_serialized_dict
17+
_convert_: object
18+
d:
19+
name: null
20+
hyperparameters:
21+
- type: constant
22+
name: fidelity
23+
value: 4
24+
meta: null
25+
- type: uniform_float
26+
name: x0_cont
27+
lower: 0.05
28+
upper: 0.15
29+
default_value: 0.1
30+
log: false
31+
meta: null
32+
- type: uniform_float
33+
name: x1_cont
34+
lower: 100.0
35+
upper: 10000.0
36+
default_value: 5050.0
37+
log: false
38+
meta: null
39+
- type: uniform_float
40+
name: x2_cont
41+
lower: 100.0
42+
upper: 1000.0
43+
default_value: 550.0
44+
log: false
45+
meta: null
46+
- type: uniform_float
47+
name: x3_cont
48+
lower: 10.0
49+
upper: 500.0
50+
default_value: 255.0
51+
log: false
52+
meta: null
53+
- type: uniform_float
54+
name: x4_cont
55+
lower: 990.0
56+
upper: 1110.0
57+
default_value: 1050.0
58+
log: false
59+
meta: null
60+
- type: uniform_float
61+
name: x5_cont
62+
lower: 700.0
63+
upper: 820.0
64+
default_value: 760.0
65+
log: false
66+
meta: null
67+
- type: uniform_float
68+
name: x6_cont
69+
lower: 1000.0
70+
upper: 2000.0
71+
default_value: 1500.0
72+
log: false
73+
meta: null
74+
- type: uniform_float
75+
name: x7_cont
76+
lower: 6000.0
77+
upper: 12000.0
78+
default_value: 9000.0
79+
log: false
80+
meta: null
81+
conditions: []
82+
forbiddens: []
83+
python_module_version: 1.2.0
84+
format_version: 0.4
85+
fidelity_space:
86+
_target_: carps.utils.task.FidelitySpace
87+
is_multifidelity: false
88+
fidelity_type: null
89+
min_fidelity: null
90+
max_fidelity: null
91+
instance_space: null
92+
output_space:
93+
_target_: carps.utils.task.OutputSpace
94+
n_objectives: 1
95+
objectives:
96+
- quality
97+
optimization_resources:
98+
_target_: carps.utils.task.OptimizationResources
99+
n_trials: 140
100+
time_budget: null
101+
n_workers: 1
102+
metadata:
103+
_target_: carps.utils.task.TaskMetadata
104+
has_constraints: false
105+
domain: real
106+
objective_function_approximation: real
107+
has_virtual_time: false
108+
deterministic: true
109+
dimensions: 9
110+
search_space_n_categoricals: 0
111+
search_space_n_ordinals: 0
112+
search_space_n_integers: 0
113+
search_space_n_floats: 9
114+
search_space_has_conditionals: false
115+
search_space_has_forbiddens: false
116+
search_space_has_priors: false
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# @package _global_
2+
benchmark_id: nasengb
3+
task_id: ${task.name}
4+
task:
5+
_target_: carps.utils.task.Task
6+
name: nasengb/PDEVar
7+
seed: ${seed}
8+
objective_function:
9+
_target_: carps.objective_functions.botorch.BOTorchObjectiveFunction
10+
botorch_problem:
11+
_target_: naseng_benchmark.pdes.PDEVar
12+
seed: ${seed}
13+
input_space:
14+
_target_: carps.utils.task.InputSpace
15+
configuration_space:
16+
_target_: ConfigSpace.configuration_space.ConfigurationSpace.from_serialized_dict
17+
_convert_: object
18+
d:
19+
name: null
20+
hyperparameters:
21+
- type: uniform_float
22+
name: x0_cont
23+
lower: 0.1
24+
upper: 5.0
25+
default_value: 2.55
26+
log: false
27+
meta: null
28+
- type: uniform_float
29+
name: x1_cont
30+
lower: 0.1
31+
upper: 5.0
32+
default_value: 2.55
33+
log: false
34+
meta: null
35+
- type: uniform_float
36+
name: x2_cont
37+
lower: 0.01
38+
upper: 5.0
39+
default_value: 2.505
40+
log: false
41+
meta: null
42+
- type: uniform_float
43+
name: x3_cont
44+
lower: 0.01
45+
upper: 5.0
46+
default_value: 2.505
47+
log: false
48+
meta: null
49+
conditions: []
50+
forbiddens: []
51+
python_module_version: 1.2.0
52+
format_version: 0.4
53+
fidelity_space:
54+
_target_: carps.utils.task.FidelitySpace
55+
is_multifidelity: false
56+
fidelity_type: null
57+
min_fidelity: null
58+
max_fidelity: null
59+
instance_space: null
60+
output_space:
61+
_target_: carps.utils.task.OutputSpace
62+
n_objectives: 1
63+
objectives:
64+
- quality
65+
optimization_resources:
66+
_target_: carps.utils.task.OptimizationResources
67+
n_trials: 100
68+
time_budget: null
69+
n_workers: 1
70+
metadata:
71+
_target_: carps.utils.task.TaskMetadata
72+
has_constraints: false
73+
domain: real
74+
objective_function_approximation: real
75+
has_virtual_time: false
76+
deterministic: true
77+
dimensions: 4
78+
search_space_n_categoricals: 0
79+
search_space_n_ordinals: 0
80+
search_space_n_integers: 0
81+
search_space_n_floats: 4
82+
search_space_has_conditionals: false
83+
search_space_has_forbiddens: false
84+
search_space_has_priors: false

0 commit comments

Comments
 (0)