-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d1afb1
commit c49cd75
Showing
6 changed files
with
13 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,23 @@ | ||
# | ||
# author: Jungtaek Kim ([email protected]) | ||
# last updated: August 17, 2023 | ||
# author: Jungtaek Kim ([email protected]) | ||
# last updated: November 20, 2024 | ||
# | ||
|
||
import numpy as np | ||
import os | ||
|
||
from bayeso import bo | ||
from bayeso_benchmarks import Ackley | ||
from bayeso import wrappers | ||
from bayeso.utils import utils_bo | ||
from bayeso.utils import utils_plotting | ||
|
||
|
||
STR_FUN_TARGET = "ackley" | ||
NUM_DIM = 3 | ||
|
||
obj_fun = Ackley(NUM_DIM) | ||
obj_fun = Ackley(3) | ||
|
||
|
||
def fun_target(X): | ||
return obj_fun.output(X) | ||
|
||
|
||
path_save = None | ||
|
||
if path_save is not None and not os.path.isdir(path_save): | ||
os.makedirs(path_save) | ||
|
||
num_bo = 5 | ||
num_iter = 10 | ||
num_init = 5 | ||
|
@@ -61,20 +51,3 @@ def fun_target(X): | |
arr_Y = np.expand_dims(np.squeeze(arr_Y), axis=0) | ||
arr_time = np.array(list_time) | ||
arr_time = np.expand_dims(arr_time, axis=0) | ||
utils_plotting.plot_minimum_vs_iter( | ||
arr_Y, | ||
[STR_FUN_TARGET], | ||
num_init, | ||
True, | ||
path_save=path_save, | ||
str_postfix=STR_FUN_TARGET, | ||
) | ||
utils_plotting.plot_minimum_vs_time( | ||
arr_time, | ||
arr_Y, | ||
[STR_FUN_TARGET], | ||
num_init, | ||
True, | ||
path_save=path_save, | ||
str_postfix=STR_FUN_TARGET, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,23 @@ | ||
# | ||
# author: Jungtaek Kim ([email protected]) | ||
# last updated: August 17, 2023 | ||
# author: Jungtaek Kim ([email protected]) | ||
# last updated: November 20, 2024 | ||
# | ||
|
||
import numpy as np | ||
import os | ||
|
||
from bayeso import bo | ||
from bayeso_benchmarks import Bohachevsky | ||
import bayeso.wrappers as wrappers | ||
from bayeso.utils import utils_bo | ||
from bayeso.utils import utils_plotting | ||
|
||
|
||
STR_FUN_TARGET = "bohachevksy" | ||
|
||
obj_fun = Bohachevsky() | ||
|
||
|
||
def fun_target(X): | ||
return obj_fun.output(X) | ||
|
||
|
||
path_save = None | ||
|
||
if path_save is not None and not os.path.isdir(path_save): | ||
os.makedirs(path_save) | ||
|
||
num_bo = 5 | ||
num_iter = 10 | ||
num_init = 5 | ||
|
@@ -63,21 +54,3 @@ def fun_target(X): | |
Ys = np.expand_dims(np.squeeze(Ys), axis=0) | ||
times = np.array(list_time) | ||
times = np.expand_dims(times, axis=0) | ||
|
||
utils_plotting.plot_minimum_vs_iter( | ||
Ys, | ||
[STR_FUN_TARGET], | ||
num_init, | ||
True, | ||
path_save=path_save, | ||
str_postfix=STR_FUN_TARGET, | ||
) | ||
utils_plotting.plot_minimum_vs_time( | ||
times, | ||
Ys, | ||
[STR_FUN_TARGET], | ||
num_init, | ||
True, | ||
path_save=path_save, | ||
str_postfix=STR_FUN_TARGET, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,23 @@ | ||
# | ||
# author: Jungtaek Kim ([email protected]) | ||
# last updated: August 17, 2023 | ||
# author: Jungtaek Kim ([email protected]) | ||
# last updated: November 20, 2024 | ||
# | ||
|
||
import numpy as np | ||
import os | ||
|
||
from bayeso import bo | ||
from bayeso_benchmarks.two_dim_branin import Branin | ||
from bayeso.wrappers import wrappers_bo_function | ||
from bayeso.utils import utils_bo | ||
from bayeso.utils import utils_plotting | ||
|
||
|
||
STR_FUN_TARGET = "branin" | ||
|
||
obj_fun = Branin() | ||
|
||
|
||
def fun_target(X): | ||
return obj_fun.output(X) | ||
|
||
|
||
path_save = None | ||
|
||
if path_save is not None and not os.path.isdir(path_save): | ||
os.makedirs(path_save) | ||
|
||
num_bo = 5 | ||
num_iter = 10 | ||
num_init = 5 | ||
|
@@ -59,20 +50,3 @@ def fun_target(X): | |
arr_Y = np.expand_dims(np.squeeze(arr_Y), axis=0) | ||
arr_time = np.array(list_time) | ||
arr_time = np.expand_dims(arr_time, axis=0) | ||
utils_plotting.plot_minimum_vs_iter( | ||
arr_Y, | ||
[STR_FUN_TARGET], | ||
num_init, | ||
True, | ||
path_save=path_save, | ||
str_postfix=STR_FUN_TARGET, | ||
) | ||
utils_plotting.plot_minimum_vs_time( | ||
arr_time, | ||
arr_Y, | ||
[STR_FUN_TARGET], | ||
num_init, | ||
True, | ||
path_save=path_save, | ||
str_postfix=STR_FUN_TARGET, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,16 @@ | ||
# | ||
# author: Jungtaek Kim ([email protected]) | ||
# last updated: August 17, 2023 | ||
# author: Jungtaek Kim ([email protected]) | ||
# last updated: November 20, 2024 | ||
# | ||
|
||
import numpy as np | ||
|
||
from bayeso import bo | ||
from bayeso import acquisition | ||
from bayeso.gp import gp | ||
from bayeso.utils import utils_common | ||
from bayeso.utils import utils_plotting | ||
from bayeso_benchmarks.two_dim_branin import Branin | ||
|
||
|
||
STR_FUN_TARGET = "branin" | ||
|
||
obj_fun = Branin() | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,22 @@ | ||
# | ||
# author: Jungtaek Kim ([email protected]) | ||
# last updated: August 17, 2023 | ||
# author: Jungtaek Kim ([email protected]) | ||
# last updated: November 20, 2024 | ||
# | ||
|
||
import numpy as np | ||
import os | ||
|
||
from bayeso import thompson_sampling as ts | ||
from bayeso_benchmarks import Branin | ||
from bayeso.utils import utils_bo | ||
from bayeso.utils import utils_plotting | ||
|
||
|
||
STR_FUN_TARGET = "branin" | ||
|
||
obj_fun = Branin() | ||
|
||
|
||
def fun_target(X): | ||
return obj_fun.output(X) | ||
|
||
|
||
path_save = None | ||
|
||
if path_save is not None and not os.path.isdir(path_save): | ||
os.makedirs(path_save) | ||
|
||
num_bo = 5 | ||
num_init = 1 | ||
num_iter = 50 | ||
|
@@ -49,11 +40,3 @@ def fun_target(X): | |
|
||
arr_Y = np.array(list_Y) | ||
arr_Y = np.expand_dims(np.squeeze(arr_Y), axis=0) | ||
utils_plotting.plot_minimum_vs_iter( | ||
arr_Y, | ||
[STR_FUN_TARGET], | ||
num_init, | ||
True, | ||
path_save=path_save, | ||
str_postfix=STR_FUN_TARGET, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,23 @@ | ||
# | ||
# author: Jungtaek Kim ([email protected]) | ||
# last updated: August 17, 2023 | ||
# author: Jungtaek Kim ([email protected]) | ||
# last updated: November 20, 2024 | ||
# | ||
|
||
import numpy as np | ||
import os | ||
|
||
from bayeso import bo | ||
from bayeso_benchmarks.six_dim_hartmann6d import Hartmann6D | ||
from bayeso.wrappers import wrappers_bo_function | ||
from bayeso.utils import utils_bo | ||
from bayeso.utils import utils_plotting | ||
|
||
|
||
STR_FUN_TARGET = "hartmann6d" | ||
|
||
obj_fun = Hartmann6D() | ||
|
||
|
||
def fun_target(X): | ||
return obj_fun.output(X) | ||
|
||
|
||
path_save = None | ||
|
||
if path_save is not None and not os.path.isdir(path_save): | ||
os.makedirs(path_save) | ||
|
||
num_bo = 5 | ||
num_iter = 10 | ||
num_init = 5 | ||
|
@@ -59,20 +50,3 @@ def fun_target(X): | |
arr_Y = np.expand_dims(np.squeeze(arr_Y), axis=0) | ||
arr_time = np.array(list_time) | ||
arr_time = np.expand_dims(arr_time, axis=0) | ||
utils_plotting.plot_minimum_vs_iter( | ||
arr_Y, | ||
[STR_FUN_TARGET], | ||
num_init, | ||
True, | ||
path_save=path_save, | ||
str_postfix=STR_FUN_TARGET, | ||
) | ||
utils_plotting.plot_minimum_vs_time( | ||
arr_time, | ||
arr_Y, | ||
[STR_FUN_TARGET], | ||
num_init, | ||
True, | ||
path_save=path_save, | ||
str_postfix=STR_FUN_TARGET, | ||
) |