Skip to content

Commit b8f3b09

Browse files
author
github-actions
committed
auto: Rebuild docs.
1 parent 3b99b53 commit b8f3b09

File tree

150 files changed

+29831
-16289
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+29831
-16289
lines changed

_downloads/06743557a28bcbf4dca92af04c48319b/pybads_example_1_basic_usage.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ def rosenbrocks_fcn(x):
1818

1919
target = rosenbrocks_fcn
2020

21-
lb = np.array([-20, -20]) # Lower bounds
22-
ub = np.array([20, 20]) # Upper bounds
23-
plb = np.array([-5, -5]) # Plausible lower bounds
24-
pub = np.array([5, 5]) # Plausible upper bounds
21+
lower_bounds = np.array([-20, -20])
22+
upper_bounds = np.array([20, 20])
23+
plausible_lower_bounds = np.array([-5, -5])
24+
plausible_upper_bounds = np.array([5, 5])
2525
x0 = np.array([0, 0])
2626
# Starting point
2727

28-
bads = BADS(target, x0, lb, ub, plb, pub)
28+
bads = BADS(target, x0, lower_bounds, upper_bounds, plausible_lower_bounds, plausible_upper_bounds)
2929
optimize_result = bads.optimize()
3030

3131
x_min = optimize_result["x"]

_downloads/66a4a0a202d9e4aaa38aa89b13027fda/pybads_example_5_extended_usage.py

+10-8
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ def camelback6(x):
1919
return f
2020

2121

22-
lb = np.array([-3, -2]) # Lower bounds
23-
ub = np.array([3, 2]) # Upper bounds
24-
plb = np.array([-2.9, -1.9]) # Plausible lower bounds
25-
pub = np.array([2.9, 1.9]) # Plausible upper bounds
22+
lower_bounds = np.array([-3, -2])
23+
upper_bounds = np.array([3, 2])
24+
plausible_lower_bounds = np.array([-2.9, -1.9])
25+
plausible_upper_bounds = np.array([2.9, 1.9])
2626

2727
options = {
2828
"display": "off", # We switch off the printing
@@ -31,13 +31,15 @@ def camelback6(x):
3131

3232
num_opts = 10
3333
optimize_results = []
34-
x_vec = np.zeros((num_opts, lb.shape[0]))
34+
x_vec = np.zeros((num_opts,lower_bounds.shape[0]))
3535
fval_vec = np.zeros(num_opts)
3636

3737
for opt_count in range(num_opts):
38-
print("Running optimization " + str(opt_count) + "...")
39-
x0 = np.random.uniform(low=plb, high=pub)
40-
bads = BADS(camelback6, x0, lb, ub, plb, pub, options=options)
38+
print('Running optimization ' + str(opt_count) + '...')
39+
options['random_seed'] = opt_count
40+
bads = BADS(
41+
camelback6, None, lower_bounds, upper_bounds, plausible_lower_bounds, plausible_upper_bounds, options=options
42+
)
4143
optimize_results.append(bads.optimize())
4244
x_vec[opt_count] = optimize_results[opt_count].x
4345
fval_vec[opt_count] = optimize_results[opt_count].fval

_downloads/74f3ba26c810ad06a6a8c73b48d40b97/pybads_example_4_user_provided_noise.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ def noisy_sphere_estimated_noise(x, scale=1.0):
1515
return y, sigma
1616

1717

18-
x0 = np.array([-3, -3])
19-
# Starting point
20-
lb = np.array([-5, -5]) # Lower bounds
21-
ub = np.array([5, 5]) # Upper bounds
22-
plb = np.array([-2, -2]) # Plausible lower bounds
23-
pub = np.array([2, 2]) # Plausible upper bounds
18+
x0 = np.array([-3, -3]) # Starting point
19+
lower_bounds = np.array([-5, -5])
20+
upper_bounds = np.array([5, 5])
21+
plausible_lower_bounds = np.array([-2, -2])
22+
plausible_upper_bounds = np.array([2, 2])
2423

2524
options = {
2625
"uncertainty_handling": True,
@@ -29,7 +28,8 @@ def noisy_sphere_estimated_noise(x, scale=1.0):
2928
}
3029

3130
bads = BADS(
32-
noisy_sphere_estimated_noise, x0, lb, ub, plb, pub, options=options
31+
noisy_sphere_estimated_noise, x0, lower_bounds, upper_bounds, plausible_lower_bounds, plausible_upper_bounds,
32+
options=options
3333
)
3434
optimize_result = bads.optimize()
3535

_downloads/e438e0f5fc735fbcda36ef39de78ec93/pybads_example_3_noisy_objective.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,19 @@ def noisy_sphere(x, sigma=1.0):
1414
return f + noise
1515

1616

17-
x0 = np.array([-3, -3])
18-
# Starting point
19-
lb = np.array([-5, -5]) # Lower bounds
20-
ub = np.array([5, 5]) # Upper bounds
21-
plb = np.array([-2, -2]) # Plausible lower bounds
22-
pub = np.array([2, 2]) # Plausible upper bounds
17+
x0 = np.array([-3, -3]) # Starting point
18+
lower_bounds = np.array([-5, -5])
19+
upper_bounds = np.array([5, 5])
20+
plausible_lower_bounds = np.array([-2, -2])
21+
plausible_upper_bounds = np.array([2, 2])
2322

2423
options = {
2524
"uncertainty_handling": True,
2625
"max_fun_evals": 300,
2726
"noise_final_samples": 100,
2827
}
2928

30-
bads = BADS(noisy_sphere, x0, lb, ub, plb, pub, options=options)
29+
bads = BADS(noisy_sphere, x0, lower_bounds, upper_bounds, plausible_lower_bounds, plausible_upper_bounds, options=options)
3130
optimize_result = bads.optimize()
3231

3332
x_min = optimize_result["x"]

_downloads/f3c67215dbe688f40d2a84390d9ecb79/pybads_example_2_nonbox_constraints.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ def rosenbrocks_fcn(x):
1616
)
1717

1818

19-
x0 = np.array([0, 0])
20-
# Starting point
21-
lb = np.array([-1, -1]) # Lower bounds
22-
ub = np.array([1, 1]) # Upper bounds
19+
x0 = np.array([0, 0]) # Starting point
20+
lower_bounds = np.array([-1, -1])
21+
upper_bounds = np.array([1, 1])
2322

2423

2524
def circle_constr(x):
@@ -29,7 +28,9 @@ def circle_constr(x):
2928
return np.sum(x_2d**2, axis=1) > 1
3029

3130

32-
bads = BADS(rosenbrocks_fcn, x0, lb, ub, non_box_cons=circle_constr)
31+
options = {}
32+
options["rng_seed"] = 3
33+
bads = BADS(rosenbrocks_fcn, x0, lower_bounds, upper_bounds, non_box_cons=circle_constr)
3334
optimize_result = bads.optimize()
3435

3536
x_min = optimize_result["x"]

0 commit comments

Comments
 (0)