Skip to content

Commit 16da920

Browse files
0.9.20
add noise to fun_control init
1 parent ee2837c commit 16da920

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77

88
[project]
99
name = "spotPython"
10-
version = "0.9.19"
10+
version = "0.9.20"
1111
authors = [
1212
{ name="T. Bartz-Beielstein", email="tbb@bartzundbartz.de" }
1313
]

src/spotPython/utils/init.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def fun_control_init(
1919
fun_repeats=1,
2020
log_level=50,
2121
max_time=1,
22+
noise=False,
2223
num_workers=0,
2324
seed=1234,
2425
sigma=0.0,
@@ -58,6 +59,9 @@ def fun_control_init(
5859
The log level. Default is 50 (ERROR).
5960
max_time (int):
6061
The maximum time in minutes.
62+
noise (bool):
63+
Whether the objective function is noiy or not. Default is False.
64+
Affects the repeat of the function evaluations.
6165
num_workers (int):
6266
The number of workers to use for the data loading. Default is 0.
6367
seed (int):
@@ -108,6 +112,7 @@ def fun_control_init(
108112
'metric_torch': None,
109113
'metric_params': {},
110114
'model_dict': {},
115+
'noise': False,
111116
'n_samples': None,
112117
'num_workers': 0,
113118
'optimizer': None,
@@ -186,6 +191,7 @@ def fun_control_init(
186191
"metric_torch": None,
187192
"metric_params": {},
188193
"model_dict": {},
194+
"noise": noise,
189195
"n_samples": None,
190196
"num_workers": num_workers,
191197
"optimizer": None,

test/test_update_design.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ def test_update_design_with_repeats_and_ocba():
3535
fun = analytical().fun_sphere
3636
fun_control = fun_control_init(
3737
sigma=0.02,
38-
seed=123,)
38+
seed=123,
39+
noise=True,
40+
fun_repeats=2)
3941
lower = np.array([-1, -1])
4042
upper = np.array([1, 1])
4143
design_control={"init_size": ni,
4244
"repeats": 2}
4345
S = spot.Spot(fun=fun,
44-
noise=True,
45-
fun_repeats=2,
4646
n_points=1,
4747
ocba_delta=1,
4848
lower = lower,
@@ -70,14 +70,15 @@ def test_update_design_with_repeats_and_ocba_no_var():
7070
fun = analytical().fun_sphere
7171
fun_control = fun_control_init(
7272
sigma=0.02,
73-
seed=123,)
73+
seed=123,
74+
noise=True,
75+
fun_repeats=2,)
7476
lower = np.array([-1, -1])
7577
upper = np.array([1, 1])
7678
design_control={"init_size": ni,
7779
"repeats": 2}
7880
S = spot.Spot(fun=fun,
7981
noise=True,
80-
fun_repeats=2,
8182
n_points=1,
8283
ocba_delta=1,
8384
lower = lower,

0 commit comments

Comments
 (0)