Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.2.0 #5

Merged
merged 25 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,22 @@ 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
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Install this project and its dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install pytest
pip install scipy
pip install --upgrade pip
pip install .[dev]
pip list
- name: Run pytest
run: |
pip install .
pytest
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
40 changes: 23 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<p align="center">
<img src="https://github.com/jungtaekkim/bayeso/blob/main/docs/_static/assets/logo_bayeso_capitalized.svg" width="400" />
<img src="https://raw.githubusercontent.com/jungtaekkim/bayeso/main/docs/_static/assets/logo_bayeso_capitalized.svg" width="400" />
</p>

# 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)

Expand All @@ -21,42 +21,36 @@ 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)

To install `bayeso-benchmarks` from source code, command
To install `bayeso-benchmarks` from source code, command the following in the `bayeso-benchmarks` root.

```shell
$ pip install .
pip install .
```
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 in the `bayeso-benchmarks` root.

```shell
$ pip install -r requirements.txt
$ python setup.py develop
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]`.

* Uninstallation

If you would like to uninstall `bayeso-benchmarks`, command it.

```shell
$ pip uninstall bayeso-benchmarks
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
Expand All @@ -71,5 +65,17 @@ Y = obj_fun.output(X)
Y_noise = obj_fun.output_gaussian_noise(X)
```

## Citation
```
@misc{KimJ2023software,
author={Kim, Jungtaek},
title={{BayesO Benchmarks}: Benchmark Functions for {Bayesian} Optimization},
doi={10.5281/zenodo.7577330},
url={https://github.com/jungtaekkim/bayeso-benchmarks},
howpublished={\url{https://doi.org/10.5281/zenodo.7577330}},
year={2023}
}
```

## License
[MIT License](LICENSE)
6 changes: 3 additions & 3 deletions bayeso_benchmarks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#
# author: Jungtaek Kim (jtkim@postech.ac.kr)
# last updated: January 6, 2023
# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com)
# last updated: January 27, 2023
#


__version__ = '0.1.7'
__version__ = '0.2.0'


from bayeso_benchmarks.inf_dim_ackley import Ackley
Expand Down
2 changes: 1 addition & 1 deletion bayeso_benchmarks/benchmark_base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# author: Jungtaek Kim (jtkim@postech.ac.kr)
# author: Jungtaek Kim (jungtaek.kim.mail@gmail.com)
# last updated: December 13, 2022
#

Expand Down
5 changes: 1 addition & 4 deletions bayeso_benchmarks/four_dim_colville.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 1 addition & 4 deletions bayeso_benchmarks/inf_dim_ackley.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 1 addition & 4 deletions bayeso_benchmarks/inf_dim_cosines.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 1 addition & 4 deletions bayeso_benchmarks/inf_dim_griewank.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 1 addition & 4 deletions bayeso_benchmarks/inf_dim_levy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 1 addition & 4 deletions bayeso_benchmarks/inf_dim_rastrigin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 1 addition & 4 deletions bayeso_benchmarks/inf_dim_rosenbrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 1 addition & 4 deletions bayeso_benchmarks/inf_dim_sphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 1 addition & 4 deletions bayeso_benchmarks/inf_dim_zakharov.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 1 addition & 4 deletions bayeso_benchmarks/one_dim_constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
13 changes: 5 additions & 8 deletions bayeso_benchmarks/one_dim_gramacyandlee2012.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -28,12 +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)

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)
5 changes: 1 addition & 4 deletions bayeso_benchmarks/one_dim_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 1 addition & 4 deletions bayeso_benchmarks/one_dim_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
13 changes: 5 additions & 8 deletions bayeso_benchmarks/six_dim_hartmann6d.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -54,12 +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)

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)
13 changes: 5 additions & 8 deletions bayeso_benchmarks/three_dim_hartmann3d.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -51,12 +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)

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)
5 changes: 1 addition & 4 deletions bayeso_benchmarks/two_dim_beale.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 1 addition & 4 deletions bayeso_benchmarks/two_dim_bohachevsky.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
11 changes: 4 additions & 7 deletions bayeso_benchmarks/two_dim_branin.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -53,10 +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)

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)
5 changes: 1 addition & 4 deletions bayeso_benchmarks/two_dim_bukin6.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
11 changes: 4 additions & 7 deletions bayeso_benchmarks/two_dim_dejong5.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -48,10 +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)

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)
Loading
Loading