From cb25671a2faaa23de90cfca1c445ca00072ea6a6 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Fri, 27 Jan 2023 17:15:00 -0500 Subject: [PATCH 01/25] Version up to 0.2.0 --- bayeso_benchmarks/__init__.py | 4 ++-- create_wheels_source.txt | 2 +- setup.py | 2 +- tests/test_version.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bayeso_benchmarks/__init__.py b/bayeso_benchmarks/__init__.py index d9eb7e4..49a572f 100644 --- a/bayeso_benchmarks/__init__.py +++ b/bayeso_benchmarks/__init__.py @@ -1,10 +1,10 @@ # # author: Jungtaek Kim (jtkim@postech.ac.kr) -# last updated: January 6, 2023 +# last updated: January 27, 2023 # -__version__ = '0.1.7' +__version__ = '0.2.0' from bayeso_benchmarks.inf_dim_ackley import Ackley diff --git a/create_wheels_source.txt b/create_wheels_source.txt index e3137c9..8f5ef1c 100644 --- a/create_wheels_source.txt +++ b/create_wheels_source.txt @@ -1,7 +1,7 @@ # Merge a working branch to a main branch first. # # Install setuptools wheel first, then command it. -python2 setup.py sdist bdist_wheel +python2 setup.py sdist bdist_wheel # It is deprecated. python3 setup.py sdist bdist_wheel # Install twine. diff --git a/setup.py b/setup.py index 85c2dd4..2d524b9 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name='bayeso-benchmarks', - version='0.1.7', + version='0.2.0', author='Jungtaek Kim', author_email='jtkim@postech.ac.kr', url='https://bayeso.org', diff --git a/tests/test_version.py b/tests/test_version.py index d967e4c..a2843f6 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -1,10 +1,10 @@ # # author: Jungtaek Kim (jtkim@postech.ac.kr) -# last updated: October 19, 2022 +# last updated: January 27, 2023 # -STR_VERSION = '0.1.7' +STR_VERSION = '0.2.0' def test_version_bayeso(): From d1aa82be355bef187e67d33fa2fb91adae1f8859 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Fri, 27 Jan 2023 17:27:00 -0500 Subject: [PATCH 02/25] Remove constructor calling for Python 2 --- bayeso_benchmarks/four_dim_colville.py | 5 +---- bayeso_benchmarks/inf_dim_ackley.py | 5 +---- bayeso_benchmarks/inf_dim_cosines.py | 5 +---- bayeso_benchmarks/inf_dim_griewank.py | 5 +---- bayeso_benchmarks/inf_dim_levy.py | 5 +---- bayeso_benchmarks/inf_dim_rastrigin.py | 5 +---- bayeso_benchmarks/inf_dim_rosenbrock.py | 5 +---- bayeso_benchmarks/inf_dim_sphere.py | 5 +---- bayeso_benchmarks/inf_dim_zakharov.py | 5 +---- bayeso_benchmarks/one_dim_constant.py | 5 +---- bayeso_benchmarks/one_dim_gramacyandlee2012.py | 5 +---- bayeso_benchmarks/one_dim_linear.py | 5 +---- bayeso_benchmarks/one_dim_step.py | 5 +---- bayeso_benchmarks/six_dim_hartmann6d.py | 5 +---- bayeso_benchmarks/three_dim_hartmann3d.py | 5 +---- bayeso_benchmarks/two_dim_beale.py | 5 +---- bayeso_benchmarks/two_dim_bohachevsky.py | 5 +---- bayeso_benchmarks/two_dim_branin.py | 5 +---- bayeso_benchmarks/two_dim_bukin6.py | 5 +---- bayeso_benchmarks/two_dim_dejong5.py | 5 +---- bayeso_benchmarks/two_dim_dropwave.py | 5 +---- bayeso_benchmarks/two_dim_easom.py | 5 +---- bayeso_benchmarks/two_dim_eggholder.py | 5 +---- bayeso_benchmarks/two_dim_goldsteinprice.py | 5 +---- bayeso_benchmarks/two_dim_holdertable.py | 5 +---- bayeso_benchmarks/two_dim_kim1.py | 5 +---- bayeso_benchmarks/two_dim_kim2.py | 5 +---- bayeso_benchmarks/two_dim_kim3.py | 5 +---- bayeso_benchmarks/two_dim_michalewicz.py | 5 +---- bayeso_benchmarks/two_dim_shubert.py | 5 +---- bayeso_benchmarks/two_dim_sixhumpcamel.py | 5 +---- bayeso_benchmarks/two_dim_threehumpcamel.py | 5 +---- 32 files changed, 32 insertions(+), 128 deletions(-) diff --git a/bayeso_benchmarks/four_dim_colville.py b/bayeso_benchmarks/four_dim_colville.py index 1416c3d..cc0788b 100644 --- a/bayeso_benchmarks/four_dim_colville.py +++ b/bayeso_benchmarks/four_dim_colville.py @@ -42,7 +42,4 @@ def __init__(self, seed=None): global_minimum = 0.0 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(Colville, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/inf_dim_ackley.py b/bayeso_benchmarks/inf_dim_ackley.py index 77a1186..c2d2b64 100644 --- a/bayeso_benchmarks/inf_dim_ackley.py +++ b/bayeso_benchmarks/inf_dim_ackley.py @@ -40,7 +40,4 @@ def __init__(self, dim_problem, seed=None): function = lambda bx: fun_target(bx, dim_problem) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) - except: - super(Ackley, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) diff --git a/bayeso_benchmarks/inf_dim_cosines.py b/bayeso_benchmarks/inf_dim_cosines.py index de52158..22f9870 100644 --- a/bayeso_benchmarks/inf_dim_cosines.py +++ b/bayeso_benchmarks/inf_dim_cosines.py @@ -33,7 +33,4 @@ def __init__(self, dim_problem, seed=None): function = lambda bx: fun_target(bx, dim_problem) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) - except: - super(Cosines, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) diff --git a/bayeso_benchmarks/inf_dim_griewank.py b/bayeso_benchmarks/inf_dim_griewank.py index c20eb46..31d5dc7 100644 --- a/bayeso_benchmarks/inf_dim_griewank.py +++ b/bayeso_benchmarks/inf_dim_griewank.py @@ -39,7 +39,4 @@ def __init__(self, dim_problem, seed=None): function = lambda bx: fun_target(bx, dim_problem) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) - except: - super(Griewank, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) diff --git a/bayeso_benchmarks/inf_dim_levy.py b/bayeso_benchmarks/inf_dim_levy.py index 833e81e..b24caeb 100644 --- a/bayeso_benchmarks/inf_dim_levy.py +++ b/bayeso_benchmarks/inf_dim_levy.py @@ -45,7 +45,4 @@ def __init__(self, dim_problem, seed=None): function = lambda bx: fun_target(bx, dim_problem) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) - except: - super(Levy, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) diff --git a/bayeso_benchmarks/inf_dim_rastrigin.py b/bayeso_benchmarks/inf_dim_rastrigin.py index 43faa7e..8c81598 100644 --- a/bayeso_benchmarks/inf_dim_rastrigin.py +++ b/bayeso_benchmarks/inf_dim_rastrigin.py @@ -37,7 +37,4 @@ def __init__(self, dim_problem, seed=None): function = lambda bx: fun_target(bx, dim_problem) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) - except: - super(Rastrigin, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) diff --git a/bayeso_benchmarks/inf_dim_rosenbrock.py b/bayeso_benchmarks/inf_dim_rosenbrock.py index e2b12fd..ed5b73a 100644 --- a/bayeso_benchmarks/inf_dim_rosenbrock.py +++ b/bayeso_benchmarks/inf_dim_rosenbrock.py @@ -37,7 +37,4 @@ def __init__(self, dim_problem, seed=None): function = lambda bx: fun_target(bx, dim_problem) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) - except: - super(Rosenbrock, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) diff --git a/bayeso_benchmarks/inf_dim_sphere.py b/bayeso_benchmarks/inf_dim_sphere.py index a68cf68..dffd432 100644 --- a/bayeso_benchmarks/inf_dim_sphere.py +++ b/bayeso_benchmarks/inf_dim_sphere.py @@ -36,7 +36,4 @@ def __init__(self, dim_problem, seed=None): function = lambda bx: fun_target(bx, dim_problem) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) - except: - super(Sphere, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) diff --git a/bayeso_benchmarks/inf_dim_zakharov.py b/bayeso_benchmarks/inf_dim_zakharov.py index bdb9918..c38cfa9 100644 --- a/bayeso_benchmarks/inf_dim_zakharov.py +++ b/bayeso_benchmarks/inf_dim_zakharov.py @@ -42,7 +42,4 @@ def __init__(self, dim_problem, seed=None): function = lambda bx: fun_target(bx, dim_problem) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) - except: - super(Zakharov, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed) diff --git a/bayeso_benchmarks/one_dim_constant.py b/bayeso_benchmarks/one_dim_constant.py index 102a7d6..2747b74 100644 --- a/bayeso_benchmarks/one_dim_constant.py +++ b/bayeso_benchmarks/one_dim_constant.py @@ -43,7 +43,4 @@ def __init__(self, global_minimum = constant function = lambda bx: fun_target(bx, dim_bx, constant) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(Constant, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/one_dim_gramacyandlee2012.py b/bayeso_benchmarks/one_dim_gramacyandlee2012.py index aa2ab1c..8b5e0cb 100644 --- a/bayeso_benchmarks/one_dim_gramacyandlee2012.py +++ b/bayeso_benchmarks/one_dim_gramacyandlee2012.py @@ -33,7 +33,4 @@ def __init__(self, seed=None): global_minimum = -0.86901113 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(GramacyAndLee2012, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/one_dim_linear.py b/bayeso_benchmarks/one_dim_linear.py index 6e03550..bb062e9 100644 --- a/bayeso_benchmarks/one_dim_linear.py +++ b/bayeso_benchmarks/one_dim_linear.py @@ -47,7 +47,4 @@ def __init__(self, global_minimum = slope * bounds[0, 1] function = lambda bx: fun_target(bx, dim_bx, slope) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(Linear, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/one_dim_step.py b/bayeso_benchmarks/one_dim_step.py index 2fb01e0..35286fb 100644 --- a/bayeso_benchmarks/one_dim_step.py +++ b/bayeso_benchmarks/one_dim_step.py @@ -58,7 +58,4 @@ def __init__(self, global_minimum = np.min(step_values) function = lambda bx: fun_target(bx, dim_bx, steps, step_values) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(Step, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/six_dim_hartmann6d.py b/bayeso_benchmarks/six_dim_hartmann6d.py index 3bc9b29..19352cd 100644 --- a/bayeso_benchmarks/six_dim_hartmann6d.py +++ b/bayeso_benchmarks/six_dim_hartmann6d.py @@ -59,7 +59,4 @@ def __init__(self, seed=None): global_minimum = -3.322368 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(Hartmann6D, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/three_dim_hartmann3d.py b/bayeso_benchmarks/three_dim_hartmann3d.py index 8379272..494cc24 100644 --- a/bayeso_benchmarks/three_dim_hartmann3d.py +++ b/bayeso_benchmarks/three_dim_hartmann3d.py @@ -56,7 +56,4 @@ def __init__(self, seed=None): global_minimum = -3.86278 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(Hartmann3D, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_beale.py b/bayeso_benchmarks/two_dim_beale.py index e98e8da..a6c5dfb 100644 --- a/bayeso_benchmarks/two_dim_beale.py +++ b/bayeso_benchmarks/two_dim_beale.py @@ -34,7 +34,4 @@ def __init__(self, seed=None): global_minimum = 0.0 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(Beale, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_bohachevsky.py b/bayeso_benchmarks/two_dim_bohachevsky.py index b421f76..24d8273 100644 --- a/bayeso_benchmarks/two_dim_bohachevsky.py +++ b/bayeso_benchmarks/two_dim_bohachevsky.py @@ -34,7 +34,4 @@ def __init__(self, seed=None): global_minimum = 0.0 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(Bohachevsky, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_branin.py b/bayeso_benchmarks/two_dim_branin.py index 3f0df1e..c3ddc49 100644 --- a/bayeso_benchmarks/two_dim_branin.py +++ b/bayeso_benchmarks/two_dim_branin.py @@ -56,7 +56,4 @@ def __init__(self, global_minimum = 0.3978874 function = lambda bx: fun_target(bx, dim_bx, a, b, c, r, s, t) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(Branin, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_bukin6.py b/bayeso_benchmarks/two_dim_bukin6.py index 07c9e51..ed3f767 100644 --- a/bayeso_benchmarks/two_dim_bukin6.py +++ b/bayeso_benchmarks/two_dim_bukin6.py @@ -34,7 +34,4 @@ def __init__(self, seed=None): global_minimum = 0.0 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(Bukin6, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_dejong5.py b/bayeso_benchmarks/two_dim_dejong5.py index bdb0d63..2477817 100644 --- a/bayeso_benchmarks/two_dim_dejong5.py +++ b/bayeso_benchmarks/two_dim_dejong5.py @@ -51,7 +51,4 @@ def __init__(self, seed=None): global_minimum = 0.9980038 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(DeJong5, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_dropwave.py b/bayeso_benchmarks/two_dim_dropwave.py index 447c1ec..9283fdf 100644 --- a/bayeso_benchmarks/two_dim_dropwave.py +++ b/bayeso_benchmarks/two_dim_dropwave.py @@ -34,7 +34,4 @@ def __init__(self, seed=None): global_minimum = -1.0 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(DropWave, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_easom.py b/bayeso_benchmarks/two_dim_easom.py index 2ccc071..51b336f 100644 --- a/bayeso_benchmarks/two_dim_easom.py +++ b/bayeso_benchmarks/two_dim_easom.py @@ -34,7 +34,4 @@ def __init__(self, seed=None): global_minimum = -1.0 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(Easom, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_eggholder.py b/bayeso_benchmarks/two_dim_eggholder.py index 8dc145c..2120e3d 100644 --- a/bayeso_benchmarks/two_dim_eggholder.py +++ b/bayeso_benchmarks/two_dim_eggholder.py @@ -34,7 +34,4 @@ def __init__(self, seed=None): global_minimum = -959.6406627 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(Eggholder, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_goldsteinprice.py b/bayeso_benchmarks/two_dim_goldsteinprice.py index 22ce195..05f7ba3 100644 --- a/bayeso_benchmarks/two_dim_goldsteinprice.py +++ b/bayeso_benchmarks/two_dim_goldsteinprice.py @@ -42,7 +42,4 @@ def __init__(self, seed=None): global_minimum = 3.0 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(GoldsteinPrice, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_holdertable.py b/bayeso_benchmarks/two_dim_holdertable.py index 62f904a..6d18c75 100644 --- a/bayeso_benchmarks/two_dim_holdertable.py +++ b/bayeso_benchmarks/two_dim_holdertable.py @@ -37,7 +37,4 @@ def __init__(self, seed=None): global_minimum = -19.2085026 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(HolderTable, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_kim1.py b/bayeso_benchmarks/two_dim_kim1.py index ea82e06..28f39b6 100644 --- a/bayeso_benchmarks/two_dim_kim1.py +++ b/bayeso_benchmarks/two_dim_kim1.py @@ -34,7 +34,4 @@ def __init__(self, seed=None): global_minimum = -1.9715232347905773 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(Kim1, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_kim2.py b/bayeso_benchmarks/two_dim_kim2.py index e6aa747..540d3a1 100644 --- a/bayeso_benchmarks/two_dim_kim2.py +++ b/bayeso_benchmarks/two_dim_kim2.py @@ -39,7 +39,4 @@ def __init__(self, seed=None): global_minimum = -3.454387473489018 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(Kim2, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_kim3.py b/bayeso_benchmarks/two_dim_kim3.py index a899fc9..1cd4dea 100644 --- a/bayeso_benchmarks/two_dim_kim3.py +++ b/bayeso_benchmarks/two_dim_kim3.py @@ -49,7 +49,4 @@ def __init__(self, seed=None): global_minimum = -4.943967919350982 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(Kim3, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_michalewicz.py b/bayeso_benchmarks/two_dim_michalewicz.py index a3f464c..d388609 100644 --- a/bayeso_benchmarks/two_dim_michalewicz.py +++ b/bayeso_benchmarks/two_dim_michalewicz.py @@ -39,7 +39,4 @@ def __init__(self, seed=None): global_minimum = -1.8013034 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(Michalewicz, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_shubert.py b/bayeso_benchmarks/two_dim_shubert.py index cb600d0..d5e6c22 100644 --- a/bayeso_benchmarks/two_dim_shubert.py +++ b/bayeso_benchmarks/two_dim_shubert.py @@ -42,7 +42,4 @@ def __init__(self, seed=None): global_minimum = -186.73090883 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(Shubert, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_sixhumpcamel.py b/bayeso_benchmarks/two_dim_sixhumpcamel.py index 767c064..4e1dd7d 100644 --- a/bayeso_benchmarks/two_dim_sixhumpcamel.py +++ b/bayeso_benchmarks/two_dim_sixhumpcamel.py @@ -35,7 +35,4 @@ def __init__(self, seed=None): global_minimum = -1.0316 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(SixHumpCamel, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_threehumpcamel.py b/bayeso_benchmarks/two_dim_threehumpcamel.py index 5c3e92c..057c3e3 100644 --- a/bayeso_benchmarks/two_dim_threehumpcamel.py +++ b/bayeso_benchmarks/two_dim_threehumpcamel.py @@ -34,7 +34,4 @@ def __init__(self, seed=None): global_minimum = 0.0 function = lambda bx: fun_target(bx, dim_bx) - try: - super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) - except: - super(ThreeHumpCamel, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) + super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) From 676bff188026278ad73727ea709ecfc657b459a6 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Sun, 29 Jan 2023 01:15:42 -0500 Subject: [PATCH 03/25] Update README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 21f994c..bb45945 100644 --- a/README.md +++ b/README.md @@ -73,3 +73,15 @@ Y_noise = obj_fun.output_gaussian_noise(X) ## License [MIT License](LICENSE) + +## Citation + +``` +@software{KimJ2023software, + author={Kim, Jungtaek}, + title={{BayesO Benchmarks}: Benchmark Functions for {Bayesian} Optimization}, + doi={10.5281/zenodo.7577331}, + url={https://github.com/jungtaekkim/bayeso-benchmarks}, + year={2023} +} +``` From 19da7cfd28422ec7addf3b37a50ef6fce0da9f6b Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Sun, 29 Jan 2023 01:18:48 -0500 Subject: [PATCH 04/25] Update README.md --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bb45945..7b8063c 100644 --- a/README.md +++ b/README.md @@ -71,11 +71,7 @@ Y = obj_fun.output(X) Y_noise = obj_fun.output_gaussian_noise(X) ``` -## License -[MIT License](LICENSE) - ## Citation - ``` @software{KimJ2023software, author={Kim, Jungtaek}, @@ -85,3 +81,6 @@ Y_noise = obj_fun.output_gaussian_noise(X) year={2023} } ``` + +## License +[MIT License](LICENSE) From 68084d403b3f9f4552c2f4cf9c582378095cf57b Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 28 Feb 2023 02:13:35 -0500 Subject: [PATCH 05/25] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b8063c..2c3f625 100644 --- a/README.md +++ b/README.md @@ -73,11 +73,12 @@ Y_noise = obj_fun.output_gaussian_noise(X) ## Citation ``` -@software{KimJ2023software, +@misc{KimJ2023software, author={Kim, Jungtaek}, title={{BayesO Benchmarks}: Benchmark Functions for {Bayesian} Optimization}, doi={10.5281/zenodo.7577331}, url={https://github.com/jungtaekkim/bayeso-benchmarks}, + howpublished={\url{https://doi.org/10.5281/zenodo.7577331}}, year={2023} } ``` From 8f4689b3fe0b7ecf647ecf7ed47e49ce7c0cf75c Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Fri, 4 Aug 2023 00:39:11 -0400 Subject: [PATCH 06/25] Fix global optima --- .../one_dim_gramacyandlee2012.py | 8 +- bayeso_benchmarks/six_dim_hartmann6d.py | 8 +- bayeso_benchmarks/three_dim_hartmann3d.py | 8 +- bayeso_benchmarks/two_dim_branin.py | 6 +- bayeso_benchmarks/two_dim_dejong5.py | 6 +- bayeso_benchmarks/two_dim_eggholder.py | 6 +- bayeso_benchmarks/two_dim_goldsteinprice.py | 6 +- bayeso_benchmarks/two_dim_holdertable.py | 6 +- bayeso_benchmarks/two_dim_kim1.py | 6 +- bayeso_benchmarks/two_dim_kim2.py | 6 +- bayeso_benchmarks/two_dim_kim3.py | 6 +- bayeso_benchmarks/two_dim_michalewicz.py | 6 +- bayeso_benchmarks/two_dim_shubert.py | 13 +- bayeso_benchmarks/two_dim_sixhumpcamel.py | 10 +- examples/find_global_minimum.py | 127 ++++++++++++++++++ examples/plot_benchmarks.py | 5 + 16 files changed, 186 insertions(+), 47 deletions(-) create mode 100644 examples/find_global_minimum.py diff --git a/bayeso_benchmarks/one_dim_gramacyandlee2012.py b/bayeso_benchmarks/one_dim_gramacyandlee2012.py index 8b5e0cb..a475f53 100644 --- a/bayeso_benchmarks/one_dim_gramacyandlee2012.py +++ b/bayeso_benchmarks/one_dim_gramacyandlee2012.py @@ -1,6 +1,6 @@ # -# author: Jungtaek Kim (jtkim@postech.ac.kr) -# last updated: February 8, 2021 +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) +# last updated: August 4, 2023 # import numpy as np @@ -28,9 +28,9 @@ def __init__(self, seed=None): assert bounds.shape[1] == 2 global_minimizers = np.array([ - [0.54856405], + [0.54856344], ]) - global_minimum = -0.86901113 + global_minimum = -0.8690111350 function = lambda bx: fun_target(bx, dim_bx) super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/six_dim_hartmann6d.py b/bayeso_benchmarks/six_dim_hartmann6d.py index 19352cd..3630395 100644 --- a/bayeso_benchmarks/six_dim_hartmann6d.py +++ b/bayeso_benchmarks/six_dim_hartmann6d.py @@ -1,6 +1,6 @@ # -# author: Jungtaek Kim (jtkim@postech.ac.kr) -# last updated: February 8, 2021 +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) +# last updated: August 4, 2023 # import numpy as np @@ -54,9 +54,9 @@ def __init__(self, seed=None): assert bounds.shape[1] == 2 global_minimizers = np.array([ - [0.20169, 0.150011, 0.476874, 0.275332, 0.311652, 0.6573], + [0.20168949, 0.15001068, 0.47687397, 0.27533242, 0.3116516, 0.65730054], ]) - global_minimum = -3.322368 + global_minimum = -3.3223680115 function = lambda bx: fun_target(bx, dim_bx) super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/three_dim_hartmann3d.py b/bayeso_benchmarks/three_dim_hartmann3d.py index 494cc24..9e65e9f 100644 --- a/bayeso_benchmarks/three_dim_hartmann3d.py +++ b/bayeso_benchmarks/three_dim_hartmann3d.py @@ -1,6 +1,6 @@ # -# author: Jungtaek Kim (jtkim@postech.ac.kr) -# last updated: February 8, 2021 +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) +# last updated: August 4, 2023 # import numpy as np @@ -51,9 +51,9 @@ def __init__(self, seed=None): assert bounds.shape[1] == 2 global_minimizers = np.array([ - [0.114614, 0.555649, 0.852547], + [0.11458889, 0.55564889, 0.85254698], ]) - global_minimum = -3.86278 + global_minimum = -3.8627797874 function = lambda bx: fun_target(bx, dim_bx) super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_branin.py b/bayeso_benchmarks/two_dim_branin.py index c3ddc49..831fca5 100644 --- a/bayeso_benchmarks/two_dim_branin.py +++ b/bayeso_benchmarks/two_dim_branin.py @@ -1,6 +1,6 @@ # -# author: Jungtaek Kim (jtkim@postech.ac.kr) -# last updated: February 8, 2021 +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) +# last updated: August 4, 2023 # import numpy as np @@ -53,7 +53,7 @@ def __init__(self, [np.pi, 2.275], [9.42478, 2.475], ]) - global_minimum = 0.3978874 + global_minimum = 0.3978873577 function = lambda bx: fun_target(bx, dim_bx, a, b, c, r, s, t) super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_dejong5.py b/bayeso_benchmarks/two_dim_dejong5.py index 2477817..bc9705b 100644 --- a/bayeso_benchmarks/two_dim_dejong5.py +++ b/bayeso_benchmarks/two_dim_dejong5.py @@ -1,6 +1,6 @@ # -# author: Jungtaek Kim (jtkim@postech.ac.kr) -# last updated: February 8, 2021 +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) +# last updated: August 4, 2023 # import numpy as np @@ -48,7 +48,7 @@ def __init__(self, seed=None): [-32.0400369, -31.9824982], [-31.98255954, -32.04163256], ]) - global_minimum = 0.9980038 + global_minimum = 0.9980038378 function = lambda bx: fun_target(bx, dim_bx) super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_eggholder.py b/bayeso_benchmarks/two_dim_eggholder.py index 2120e3d..3865cbe 100644 --- a/bayeso_benchmarks/two_dim_eggholder.py +++ b/bayeso_benchmarks/two_dim_eggholder.py @@ -1,6 +1,6 @@ # -# author: Jungtaek Kim (jtkim@postech.ac.kr) -# last updated: January 13, 2023 +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) +# last updated: August 4, 2023 # import numpy as np @@ -31,7 +31,7 @@ def __init__(self, seed=None): global_minimizers = np.array([ [512.0, 404.2319], ]) - global_minimum = -959.6406627 + global_minimum = -959.6406627209 function = lambda bx: fun_target(bx, dim_bx) super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_goldsteinprice.py b/bayeso_benchmarks/two_dim_goldsteinprice.py index 05f7ba3..563a5e6 100644 --- a/bayeso_benchmarks/two_dim_goldsteinprice.py +++ b/bayeso_benchmarks/two_dim_goldsteinprice.py @@ -1,6 +1,6 @@ # -# author: Jungtaek Kim (jtkim@postech.ac.kr) -# last updated: February 8, 2021 +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) +# last updated: August 4, 2023 # import numpy as np @@ -39,7 +39,7 @@ def __init__(self, seed=None): global_minimizers = np.array([ [0.0, -1.0], ]) - global_minimum = 3.0 + global_minimum = 2.9999999999 function = lambda bx: fun_target(bx, dim_bx) super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_holdertable.py b/bayeso_benchmarks/two_dim_holdertable.py index 6d18c75..cc45100 100644 --- a/bayeso_benchmarks/two_dim_holdertable.py +++ b/bayeso_benchmarks/two_dim_holdertable.py @@ -1,6 +1,6 @@ # -# author: Jungtaek Kim (jtkim@postech.ac.kr) -# last updated: February 8, 2021 +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) +# last updated: August 4, 2023 # import numpy as np @@ -34,7 +34,7 @@ def __init__(self, seed=None): [-8.05502347, 9.66459002], [-8.05502347, -9.66459002], ]) - global_minimum = -19.2085026 + global_minimum = -19.2085025679 function = lambda bx: fun_target(bx, dim_bx) super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_kim1.py b/bayeso_benchmarks/two_dim_kim1.py index 28f39b6..ac895e9 100644 --- a/bayeso_benchmarks/two_dim_kim1.py +++ b/bayeso_benchmarks/two_dim_kim1.py @@ -1,6 +1,6 @@ # -# author: Jungtaek Kim (jtkim@postech.ac.kr) -# last updated: October 27, 2021 +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) +# last updated: August 4, 2023 # import numpy as np @@ -31,7 +31,7 @@ def __init__(self, seed=None): global_minimizers = np.array([ [4.72130726, 3.17086303], ]) - global_minimum = -1.9715232347905773 + global_minimum = -1.9715232348 function = lambda bx: fun_target(bx, dim_bx) super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_kim2.py b/bayeso_benchmarks/two_dim_kim2.py index 540d3a1..38d4689 100644 --- a/bayeso_benchmarks/two_dim_kim2.py +++ b/bayeso_benchmarks/two_dim_kim2.py @@ -1,6 +1,6 @@ # -# author: Jungtaek Kim (jtkim@postech.ac.kr) -# last updated: October 27, 2021 +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) +# last updated: August 4, 2023 # import numpy as np @@ -36,7 +36,7 @@ def __init__(self, seed=None): global_minimizers = np.array([ [-2.1013466, 34.14526252], ]) - global_minimum = -3.454387473489018 + global_minimum = -3.4543874735 function = lambda bx: fun_target(bx, dim_bx) super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_kim3.py b/bayeso_benchmarks/two_dim_kim3.py index 1cd4dea..b3b90ad 100644 --- a/bayeso_benchmarks/two_dim_kim3.py +++ b/bayeso_benchmarks/two_dim_kim3.py @@ -1,6 +1,6 @@ # -# author: Jungtaek Kim (jtkim@postech.ac.kr) -# last updated: October 27, 2021 +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) +# last updated: August 4, 2023 # import numpy as np @@ -46,7 +46,7 @@ def __init__(self, seed=None): global_minimizers = np.array([ [48.12477173, 34.19859065], ]) - global_minimum = -4.943967919350982 + global_minimum = -4.9439679194 function = lambda bx: fun_target(bx, dim_bx) super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_michalewicz.py b/bayeso_benchmarks/two_dim_michalewicz.py index d388609..577e04d 100644 --- a/bayeso_benchmarks/two_dim_michalewicz.py +++ b/bayeso_benchmarks/two_dim_michalewicz.py @@ -1,6 +1,6 @@ # -# author: Jungtaek Kim (jtkim@postech.ac.kr) -# last updated: February 8, 2021 +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) +# last updated: August 4, 2023 # import numpy as np @@ -36,7 +36,7 @@ def __init__(self, seed=None): global_minimizers = np.array([ [2.20290552, 1.57079632], ]) - global_minimum = -1.8013034 + global_minimum = -1.8013034101 function = lambda bx: fun_target(bx, dim_bx) super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_shubert.py b/bayeso_benchmarks/two_dim_shubert.py index d5e6c22..202d1ec 100644 --- a/bayeso_benchmarks/two_dim_shubert.py +++ b/bayeso_benchmarks/two_dim_shubert.py @@ -1,6 +1,6 @@ # -# author: Jungtaek Kim (jtkim@postech.ac.kr) -# last updated: January 3, 2023 +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) +# last updated: August 4, 2023 # import numpy as np @@ -38,8 +38,15 @@ def __init__(self, seed=None): global_minimizers = np.array([ [-7.08350641, -7.70831374], + [5.48286421, -7.70831373], + [-0.8003211, -7.70831374], + [4.85805688, -7.08350641], + [-7.70831374, -0.8003211], + [-7.70831374, 5.4828642], + [4.85805688, 5.48286421], ]) - global_minimum = -186.73090883 + global_minimum = -186.7309088311 + function = lambda bx: fun_target(bx, dim_bx) super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/bayeso_benchmarks/two_dim_sixhumpcamel.py b/bayeso_benchmarks/two_dim_sixhumpcamel.py index 4e1dd7d..0485047 100644 --- a/bayeso_benchmarks/two_dim_sixhumpcamel.py +++ b/bayeso_benchmarks/two_dim_sixhumpcamel.py @@ -1,6 +1,6 @@ # -# author: Jungtaek Kim (jtkim@postech.ac.kr) -# last updated: February 8, 2021 +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) +# last updated: August 4, 2023 # import numpy as np @@ -29,10 +29,10 @@ def __init__(self, seed=None): assert bounds.shape[1] == 2 global_minimizers = np.array([ - [0.0898, -0.7126], - [-0.0898, 0.7126], + [0.08984201, -0.7126564], + [-0.08984201, 0.7126564], ]) - global_minimum = -1.0316 + global_minimum = -1.0316284535 function = lambda bx: fun_target(bx, dim_bx) super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, seed=seed) diff --git a/examples/find_global_minimum.py b/examples/find_global_minimum.py new file mode 100644 index 0000000..98b83e5 --- /dev/null +++ b/examples/find_global_minimum.py @@ -0,0 +1,127 @@ +# +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) +# last updated: August 4, 2023 +# + +import numpy as np +import scipy.optimize as scio + +from bayeso_benchmarks import Ackley +from bayeso_benchmarks import Cosines +from bayeso_benchmarks import Griewank +from bayeso_benchmarks import Levy +from bayeso_benchmarks import Rastrigin +from bayeso_benchmarks import Rosenbrock +from bayeso_benchmarks import Sphere +from bayeso_benchmarks import Zakharov +from bayeso_benchmarks import GramacyAndLee2012 +from bayeso_benchmarks import Beale +from bayeso_benchmarks import Bohachevsky +from bayeso_benchmarks import Branin +from bayeso_benchmarks import Bukin6 +from bayeso_benchmarks import DeJong5 +from bayeso_benchmarks import DropWave +from bayeso_benchmarks import Easom +from bayeso_benchmarks import Eggholder +from bayeso_benchmarks import GoldsteinPrice +from bayeso_benchmarks import HolderTable +from bayeso_benchmarks import Kim1 +from bayeso_benchmarks import Kim2 +from bayeso_benchmarks import Kim3 +from bayeso_benchmarks import Michalewicz +from bayeso_benchmarks import Shubert +from bayeso_benchmarks import SixHumpCamel +from bayeso_benchmarks import ThreeHumpCamel +from bayeso_benchmarks import Colville +from bayeso_benchmarks import Hartmann3D +from bayeso_benchmarks import Hartmann6D + + +TEST_EPSILON = 1e-7 + +all_benchmarks = [ + Ackley, + Cosines, + Griewank, + Levy, + Rastrigin, + Rosenbrock, + Sphere, + Zakharov, + GramacyAndLee2012, + Beale, + Bohachevsky, + Branin, + Bukin6, + DeJong5, + DropWave, + Easom, + Eggholder, + GoldsteinPrice, + HolderTable, + Kim1, + Kim2, + Kim3, + Michalewicz, + Shubert, + SixHumpCamel, + ThreeHumpCamel, + Colville, + Hartmann3D, + Hartmann6D, +] + + +def find_global_minimum(obj_fun): + print(obj_fun.name, flush=True) + + fun_target = lambda bx: np.squeeze(obj_fun.output(bx), axis=1) + + grids = obj_fun.sample_grids(5) + grids = np.concatenate((grids, obj_fun.get_global_minimizers()), axis=0) + + list_bx = [] + list_by = [] + + for initial in grids: + results = scio.minimize(fun_target, initial, method='L-BFGS-B', bounds=obj_fun.get_bounds()) + + list_bx.append(results.x) + list_by.append(results.fun) + + ind_minimum = np.argmin(np.squeeze(list_by)) + bx_best = list_bx[ind_minimum] + y_best = list_by[ind_minimum] + + print(bx_best, flush=True) + print(obj_fun.global_minimum, flush=True) + print(y_best, flush=True) + print('', flush=True) + + X = np.array(list_bx) + by = np.squeeze(list_by) + indices = np.argsort(by) + X = X[indices] + by = by[indices] + + print('candidates of global optima', flush=True) + for bx_candidate, y_candidate in zip(X, by): + if (obj_fun.global_minimum - y_candidate) > 0: + print(bx_candidate, y_candidate, flush=True) + print('', flush=True) + + assert (obj_fun.global_minimum - y_best) <= TEST_EPSILON + assert (obj_fun.global_minimum - y_best) <= 0 + + for global_minimizer in obj_fun.get_global_minimizers(): + assert (obj_fun.global_minimum - fun_target(global_minimizer)[0]) <= 0 + + +if __name__ == '__main__': + for class_fun in all_benchmarks: + try: + obj_fun = class_fun() + except: + obj_fun = class_fun(2) + + find_global_minimum(obj_fun) diff --git a/examples/plot_benchmarks.py b/examples/plot_benchmarks.py index d025f02..c268e0b 100644 --- a/examples/plot_benchmarks.py +++ b/examples/plot_benchmarks.py @@ -1,3 +1,8 @@ +# +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) +# last updated: August 4, 2023 +# + import numpy as np import os import matplotlib.pyplot as plt From d62e1a0b1927f8ceda3e012cee91830970e5c253 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Fri, 4 Aug 2023 00:50:11 -0400 Subject: [PATCH 07/25] Fix global optima --- bayeso_benchmarks/two_dim_eggholder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bayeso_benchmarks/two_dim_eggholder.py b/bayeso_benchmarks/two_dim_eggholder.py index 3865cbe..ebec20b 100644 --- a/bayeso_benchmarks/two_dim_eggholder.py +++ b/bayeso_benchmarks/two_dim_eggholder.py @@ -29,7 +29,7 @@ def __init__(self, seed=None): assert bounds.shape[1] == 2 global_minimizers = np.array([ - [512.0, 404.2319], + [512.0, 404.2318066], ]) global_minimum = -959.6406627209 function = lambda bx: fun_target(bx, dim_bx) From 915e15bf45632d091ca350046b13640d8f3e5ff4 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 21 Nov 2023 15:35:20 -0500 Subject: [PATCH 08/25] Update README.md and add publish_new_release.txt --- README.md | 8 ++++---- create_wheels_source.txt | 13 ------------- publish_new_release.txt | 29 +++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 17 deletions(-) delete mode 100644 create_wheels_source.txt create mode 100644 publish_new_release.txt diff --git a/README.md b/README.md index 2c3f625..1a0cea9 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@

- +

# BayesO Benchmarks: Benchmark Functions for Bayesian Optimization -[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7577331.svg)](https://doi.org/10.5281/zenodo.7577331) +[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7577330.svg)](https://doi.org/10.5281/zenodo.7577330) [![Build Status](https://github.com/jungtaekkim/bayeso-benchmarks/actions/workflows/pytest.yml/badge.svg)](https://github.com/jungtaekkim/bayeso-benchmarks/actions/workflows/pytest.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) @@ -76,9 +76,9 @@ Y_noise = obj_fun.output_gaussian_noise(X) @misc{KimJ2023software, author={Kim, Jungtaek}, title={{BayesO Benchmarks}: Benchmark Functions for {Bayesian} Optimization}, - doi={10.5281/zenodo.7577331}, + doi={10.5281/zenodo.7577330}, url={https://github.com/jungtaekkim/bayeso-benchmarks}, - howpublished={\url{https://doi.org/10.5281/zenodo.7577331}}, + howpublished={\url{https://doi.org/10.5281/zenodo.7577330}}, year={2023} } ``` diff --git a/create_wheels_source.txt b/create_wheels_source.txt deleted file mode 100644 index 8f5ef1c..0000000 --- a/create_wheels_source.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Merge a working branch to a main branch first. -# -# Install setuptools wheel first, then command it. -python2 setup.py sdist bdist_wheel # It is deprecated. -python3 setup.py sdist bdist_wheel - -# Install twine. -twine upload dist/* - -## (Optional) Upload to Anaconda repository. -~/anaconda3/bin/anaconda upload dist/*.tar.gz -# or, just -anaconda upload dist/*.tar.gz diff --git a/publish_new_release.txt b/publish_new_release.txt new file mode 100644 index 0000000..a5bd272 --- /dev/null +++ b/publish_new_release.txt @@ -0,0 +1,29 @@ +# 1. Merge a working branch to the main branch first. + +# 2. Clone the main branch in a new clean directory. + +# 3. (If needed) Install setuptools and wheel. + +# 4. Create wheel and source files. +python2 setup.py sdist bdist_wheel (deprecated) +python3 setup.py sdist bdist_wheel + +# 5. (If needed) Install twine. + +# 6. Upload wheel and source files to the PyPI repository. +twine upload dist/* + +# 7. (Optional) Upload to Anaconda repository. +~/anaconda3/bin/anaconda upload dist/*.tar.gz +# or +anaconda upload dist/*.tar.gz + +# 8. Publish a new release at GitHub. +## Create a tag at GitHub. +## Make sure that it is created in the main branch. +## Assign the tag to a new release. +## The name convention of tags is "v0.5.5". +## Upload the wheel and source files, which can be downloaded from the PyPI repository, together. + +# 9. Check out Zenodo or upload the release on Zenodo. +## To upload the release, download a ZIP file from a particular tag. From 019c92a40d6e7ed207134b9acc555305bdbea16e Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 21 Nov 2023 15:46:05 -0500 Subject: [PATCH 09/25] Update pytest.yml --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 91d201a..9b3b4bf 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -13,7 +13,7 @@ jobs: - '3.9' - '3.10' - '3.11' - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 From 0221491ef77a7d0e1b8a0582bf9acea8240dfd00 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 21 Nov 2023 15:47:55 -0500 Subject: [PATCH 10/25] Update pytest.yml --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 9b3b4bf..91d201a 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -13,7 +13,7 @@ jobs: - '3.9' - '3.10' - '3.11' - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 From 5b26b1d17c88eaba0f84eb33f1c245363a26fecd Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Thu, 4 Jan 2024 14:20:36 -0500 Subject: [PATCH 11/25] Happy new year --- LICENSE | 2 +- bayeso_benchmarks/__init__.py | 2 +- bayeso_benchmarks/benchmark_base.py | 2 +- bayeso_benchmarks/utils.py | 2 +- setup.py | 11 +++++++++-- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/LICENSE b/LICENSE index 60c4a91..79587aa 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019-2023 Jungtaek Kim +Copyright (c) 2019-2024 Jungtaek Kim Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/bayeso_benchmarks/__init__.py b/bayeso_benchmarks/__init__.py index 49a572f..0467deb 100644 --- a/bayeso_benchmarks/__init__.py +++ b/bayeso_benchmarks/__init__.py @@ -1,5 +1,5 @@ # -# author: Jungtaek Kim (jtkim@postech.ac.kr) +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) # last updated: January 27, 2023 # diff --git a/bayeso_benchmarks/benchmark_base.py b/bayeso_benchmarks/benchmark_base.py index c3d5472..b5d92f6 100644 --- a/bayeso_benchmarks/benchmark_base.py +++ b/bayeso_benchmarks/benchmark_base.py @@ -1,5 +1,5 @@ # -# author: Jungtaek Kim (jtkim@postech.ac.kr) +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) # last updated: December 13, 2022 # diff --git a/bayeso_benchmarks/utils.py b/bayeso_benchmarks/utils.py index 4fc6189..fcc4af6 100644 --- a/bayeso_benchmarks/utils.py +++ b/bayeso_benchmarks/utils.py @@ -1,5 +1,5 @@ # -# author: Jungtaek Kim (jtkim@postech.ac.kr) +# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com) # last updated: January 4, 2023 # diff --git a/setup.py b/setup.py index 2d524b9..99a468d 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,9 @@ from setuptools import setup +from pathlib import Path + + +this_directory = Path(__file__).parent +long_description = (this_directory / "README.md").read_text() path_requirements = 'requirements.txt' list_packages = ['bayeso_benchmarks'] @@ -10,10 +15,12 @@ name='bayeso-benchmarks', version='0.2.0', author='Jungtaek Kim', - author_email='jtkim@postech.ac.kr', + author_email='jungtaek.kim.mail@gmail.com', url='https://bayeso.org', license='MIT', - description='Benchmarks for Bayesian optimization', + description='Benchmark Functions for Bayesian optimization', + long_description=long_description, + long_description_content_type='text/markdown', packages=list_packages, python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, != 3.3.*, !=3.4.*, !=3.5.*, <4', install_requires=required, From 620c08bdbe21b3cb5af3b1ae0e817a032e0a2a62 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 27 Feb 2024 18:09:03 -0500 Subject: [PATCH 12/25] Replace setup.py with pyproject.toml --- pyproject.toml | 41 +++++++++++++++++++++++++++++++++++++++++ requirements-dev.txt | 3 --- requirements.txt | 1 - setup.py | 32 -------------------------------- 4 files changed, 41 insertions(+), 36 deletions(-) create mode 100644 pyproject.toml delete mode 100644 requirements-dev.txt delete mode 100644 requirements.txt delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..ae7fc5f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,41 @@ +[build-system] +build-backend = "setuptools.build_meta" +requires = [ + "setuptools", + "setuptools-scm", + "numpy", +] + +[tool.setuptools] +packages = ["bayeso_benchmarks"] + +[project] +name = "bayeso-benchmarks" +version = "0.2.0" +authors = [ + {name = "Jungtaek Kim", email = "jungtaek.kim.mail@gmail.com"}, +] +description = "Benchmark functions for Bayesian optimization" +readme = "README.md" +requires-python = ">=3.6" +license = {text = "MIT"} +classifiers = [ + "Programming Language :: Python :: 3", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Artificial Intelligence", +] + +[project.urls] +Homepage = "https://bayeso.org" +Source = "https://github.com/jungtaekkim/bayeso-benchmarks" +Issues = "https://github.com/jungtaekkim/bayeso-benchmarks/issues" + +[tool.pip-compile.optional-dependencies] +dev = [ + "pytest", + "scipy", + "matplotlib", +] diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 34fccf8..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,3 +0,0 @@ -pytest -scipy -matplotlib diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 24ce15a..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -numpy diff --git a/setup.py b/setup.py deleted file mode 100644 index 99a468d..0000000 --- a/setup.py +++ /dev/null @@ -1,32 +0,0 @@ -from setuptools import setup -from pathlib import Path - - -this_directory = Path(__file__).parent -long_description = (this_directory / "README.md").read_text() - -path_requirements = 'requirements.txt' -list_packages = ['bayeso_benchmarks'] - -with open(path_requirements) as f: - required = f.read().splitlines() - -setup( - name='bayeso-benchmarks', - version='0.2.0', - author='Jungtaek Kim', - author_email='jungtaek.kim.mail@gmail.com', - url='https://bayeso.org', - license='MIT', - description='Benchmark Functions for Bayesian optimization', - long_description=long_description, - long_description_content_type='text/markdown', - packages=list_packages, - python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, != 3.3.*, !=3.4.*, !=3.5.*, <4', - install_requires=required, - classifiers=[ - 'License :: OSI Approved :: MIT License', - 'Topic :: Scientific/Engineering', - 'Topic :: Scientific/Engineering :: Artificial Intelligence', - ] -) From 3005b51fbbd028ea59b3c43eee3fd36853b65647 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 27 Feb 2024 18:13:32 -0500 Subject: [PATCH 13/25] Fix an error for GitHub Actions --- .github/workflows/pytest.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 91d201a..c17eb06 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -21,10 +21,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip setuptools - pip install pytest - pip install scipy + pip install .[dev] - name: Run pytest run: | - pip install . pytest From be6e3648080d24788c047fdc132364eaa4e542fe Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 27 Feb 2024 18:13:55 -0500 Subject: [PATCH 14/25] Update README.md --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1a0cea9..a76d226 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ $ pip install bayeso-benchmarks * Using source code (for developer installation) -To install `bayeso-benchmarks` from source code, command +To install `bayeso-benchmarks` from source code, command the following. ```shell $ pip install . @@ -35,11 +35,10 @@ in the `bayeso-benchmarks` root. * Using source code (for editable development mode) -To use editable development mode, command +To use editable development mode, command the following. ```shell -$ pip install -r requirements.txt -$ python setup.py develop +$ pip install -e . ``` in the `bayeso-benchmarks` root. From 0c6cf91229321d9898ccacbb2f1023fe9dbb7f04 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 27 Feb 2024 18:23:43 -0500 Subject: [PATCH 15/25] Fix an error for pytest.yml --- .github/workflows/pytest.yml | 3 ++- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c17eb06..a313416 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -19,8 +19,9 @@ jobs: - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + - name: Install this project and its dependencies run: | + pip install --upgrade pip pip install .[dev] - name: Run pytest run: | diff --git a/pyproject.toml b/pyproject.toml index ae7fc5f..5e78b82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ Homepage = "https://bayeso.org" Source = "https://github.com/jungtaekkim/bayeso-benchmarks" Issues = "https://github.com/jungtaekkim/bayeso-benchmarks/issues" -[tool.pip-compile.optional-dependencies] +[project.optional-dependencies] dev = [ "pytest", "scipy", From 8bc808d30103fd8c8e6ab6e7001c21d1991e9aa4 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 27 Feb 2024 18:27:57 -0500 Subject: [PATCH 16/25] Fix an error for pytest.yml --- .github/workflows/pytest.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index a313416..f53a64f 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -7,13 +7,12 @@ jobs: strategy: matrix: python-version: - - '3.6' - '3.7' - '3.8' - '3.9' - '3.10' - '3.11' - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 From 91994213982a64ed2fc9b7578c98a08f816105ce Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 27 Feb 2024 18:33:43 -0500 Subject: [PATCH 17/25] Update README.md --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a76d226..e6d3109 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,11 @@ $ pip install -e . ``` in the `bayeso-benchmarks` root. +If you want to install Python packages for development, you can simply command it by adding `[dev]`. +```shell +$ pip install -e .[dev] +``` + * Uninstallation If you would like to uninstall `bayeso-benchmarks`, command it. @@ -50,12 +55,6 @@ If you would like to uninstall `bayeso-benchmarks`, command it. $ pip uninstall bayeso-benchmarks ``` -## Required Packages -Mandatory pacakges are inlcuded in `requirements.txt`. -The following `requirements` files include the package list, the purpose of which is described as follows. - -* `requirements-dev.txt`: It is for developing the `bayeso-benchmarks` package. - ## Simple Example A simple example on Branin function is shown below. ```python From d2825ff43433f470717918d41ba860eeef4cc4e0 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 27 Feb 2024 18:44:28 -0500 Subject: [PATCH 18/25] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e6d3109..fe39379 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ You can choose one of three installation options. To install the released version in PyPI repository, command it. ```shell -$ pip install bayeso-benchmarks +pip install bayeso-benchmarks ``` * Using source code (for developer installation) @@ -29,7 +29,7 @@ $ pip install bayeso-benchmarks To install `bayeso-benchmarks` from source code, command the following. ```shell -$ pip install . +pip install . ``` in the `bayeso-benchmarks` root. @@ -38,13 +38,13 @@ in the `bayeso-benchmarks` root. To use editable development mode, command the following. ```shell -$ pip install -e . +pip install -e . ``` in the `bayeso-benchmarks` root. If you want to install Python packages for development, you can simply command it by adding `[dev]`. ```shell -$ pip install -e .[dev] +pip install -e .[dev] ``` * Uninstallation @@ -52,7 +52,7 @@ $ pip install -e .[dev] If you would like to uninstall `bayeso-benchmarks`, command it. ```shell -$ pip uninstall bayeso-benchmarks +pip uninstall bayeso-benchmarks ``` ## Simple Example From 1c89d9e33036c23ee1bd3281212b20f74d8028f5 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 27 Feb 2024 18:44:49 -0500 Subject: [PATCH 19/25] Update pyproject.toml --- .github/workflows/pytest.yml | 1 + pyproject.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index f53a64f..5a89184 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -22,6 +22,7 @@ jobs: run: | pip install --upgrade pip pip install .[dev] + pip list - name: Run pytest run: | pytest diff --git a/pyproject.toml b/pyproject.toml index 5e78b82..70d5bf1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,7 @@ Issues = "https://github.com/jungtaekkim/bayeso-benchmarks/issues" [project.optional-dependencies] dev = [ "pytest", + "twine", "scipy", "matplotlib", ] From 56caf9a17ba2ec89ad6f4308a7466f5a1df9985e Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 27 Feb 2024 18:48:20 -0500 Subject: [PATCH 20/25] Update pyproject.toml --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 70d5bf1..20300a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,7 @@ Issues = "https://github.com/jungtaekkim/bayeso-benchmarks/issues" [project.optional-dependencies] dev = [ "pytest", + "wheel", "twine", "scipy", "matplotlib", From c6f32a6261e3f86e78553d3b84ea40d4a7b781c3 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Wed, 28 Feb 2024 12:07:17 -0500 Subject: [PATCH 21/25] Update pyproject.toml --- pyproject.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 20300a6..9d53f00 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,6 @@ build-backend = "setuptools.build_meta" requires = [ "setuptools", "setuptools-scm", - "numpy", ] [tool.setuptools] @@ -17,7 +16,10 @@ authors = [ ] description = "Benchmark functions for Bayesian optimization" readme = "README.md" -requires-python = ">=3.6" +requires-python = ">=3.7" +dependencies = [ + "numpy", +] license = {text = "MIT"} classifiers = [ "Programming Language :: Python :: 3", From 5c768777727859923e92c5df45707ad941b74a4c Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Wed, 28 Feb 2024 12:09:33 -0500 Subject: [PATCH 22/25] Update README.md --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fe39379..ab53319 100644 --- a/README.md +++ b/README.md @@ -42,10 +42,8 @@ pip install -e . ``` in the `bayeso-benchmarks` root. -If you want to install Python packages for development, you can simply command it by adding `[dev]`. -```shell -pip install -e .[dev] -``` +If you want to install the packages required for development, you can simply add `[dev]`. +For example, `pip install .[dev]` or `pip install -e .[dev]`. * Uninstallation From ec9d5f6da5c3bbeea38d434c2f7cb0618c7bc761 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Wed, 28 Feb 2024 12:12:08 -0500 Subject: [PATCH 23/25] Update README.md --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ab53319..e19434f 100644 --- a/README.md +++ b/README.md @@ -26,21 +26,19 @@ pip install bayeso-benchmarks * Using source code (for developer installation) -To install `bayeso-benchmarks` from source code, command the following. +To install `bayeso-benchmarks` from source code, command the following in the `bayeso-benchmarks` root. ```shell pip install . ``` -in the `bayeso-benchmarks` root. * Using source code (for editable development mode) -To use editable development mode, command the following. +To use editable development mode, command the following in the `bayeso-benchmarks` root. ```shell pip install -e . ``` -in the `bayeso-benchmarks` root. If you want to install the packages required for development, you can simply add `[dev]`. For example, `pip install .[dev]` or `pip install -e .[dev]`. From c833c804e3d4b128f6ee44b2685f6f21e5980dc4 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 12 Mar 2024 11:32:03 -0400 Subject: [PATCH 24/25] Update pyproject.toml and publishing guide --- publish_new_release.txt | 21 +++++++++------------ pyproject.toml | 1 + 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/publish_new_release.txt b/publish_new_release.txt index a5bd272..71c2202 100644 --- a/publish_new_release.txt +++ b/publish_new_release.txt @@ -1,29 +1,26 @@ +# 0. (If needed) Install setuptools, wheel, and twine. + # 1. Merge a working branch to the main branch first. # 2. Clone the main branch in a new clean directory. -# 3. (If needed) Install setuptools and wheel. - -# 4. Create wheel and source files. -python2 setup.py sdist bdist_wheel (deprecated) -python3 setup.py sdist bdist_wheel - -# 5. (If needed) Install twine. +# 3. Create wheel and source files. +python3 -m build -# 6. Upload wheel and source files to the PyPI repository. -twine upload dist/* +# 4. Upload wheel and source files to the PyPI repository. +python3 -m twine upload dist/* -# 7. (Optional) Upload to Anaconda repository. +# 5. (Optional) Upload to Anaconda repository. ~/anaconda3/bin/anaconda upload dist/*.tar.gz # or anaconda upload dist/*.tar.gz -# 8. Publish a new release at GitHub. +# 6. Publish a new release at GitHub. ## Create a tag at GitHub. ## Make sure that it is created in the main branch. ## Assign the tag to a new release. ## The name convention of tags is "v0.5.5". ## Upload the wheel and source files, which can be downloaded from the PyPI repository, together. -# 9. Check out Zenodo or upload the release on Zenodo. +# 7. Check out Zenodo or upload the release on Zenodo. ## To upload the release, download a ZIP file from a particular tag. diff --git a/pyproject.toml b/pyproject.toml index 9d53f00..328c52e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,7 @@ Issues = "https://github.com/jungtaekkim/bayeso-benchmarks/issues" dev = [ "pytest", "wheel", + "build", "twine", "scipy", "matplotlib", From dbb1196d43611d3aaa842ca9f04102e1c1583c92 Mon Sep 17 00:00:00 2001 From: Jungtaek Kim Date: Tue, 12 Mar 2024 14:28:20 -0400 Subject: [PATCH 25/25] Update publish_new_release --- publish_new_release.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/publish_new_release.txt b/publish_new_release.txt index 71c2202..15eb92e 100644 --- a/publish_new_release.txt +++ b/publish_new_release.txt @@ -1,4 +1,4 @@ -# 0. (If needed) Install setuptools, wheel, and twine. +# 0. (If needed) Install setuptools, wheel, build, and twine. # 1. Merge a working branch to the main branch first.