Skip to content

Commit 6e82748

Browse files
authored
Merge pull request #3 from jungtaekkim/0.1.6
0.1.6
2 parents 3650aae + 05d116b commit 6e82748

Some content is hidden

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

61 files changed

+638
-61
lines changed

.github/workflows/pytest.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: pytest
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
strategy:
8+
matrix:
9+
python-version:
10+
- '3.6'
11+
- '3.7'
12+
- '3.8'
13+
- '3.9'
14+
- '3.10'
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-python@v2
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip setuptools
24+
pip install pytest
25+
pip install scipy
26+
- name: Run pytest
27+
run: |
28+
pip install .
29+
pytest

.travis.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019-2021 Jungtaek Kim
3+
Copyright (c) 2019-2022 Jungtaek Kim
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# BayesO Benchmarks
2-
[![Build Status](https://app.travis-ci.com/jungtaekkim/bayeso-benchmarks.svg?branch=main)](https://app.travis-ci.com/jungtaekkim/bayeso-benchmarks)
2+
[![Build Status](https://github.com/jungtaekkim/bayeso-benchmarks/actions/workflows/pytest.yml/badge.svg)](https://github.com/jungtaekkim/bayeso-benchmarks/actions/workflows/pytest.yml)
33
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
44

55
Benchmarks for Bayesian optimization.
6-
The details of benchmark functions can be found in [these notes](http://jungtaek.github.io/notes/benchmarks_bo.pdf).
6+
The details of benchmark functions can be found in [these notes](https://jungtaek.github.io/notes/benchmarks_bo.pdf).
77

88
## Installation
99
We recommend installing it with `virtualenv`.
@@ -65,10 +65,7 @@ Y_noise = obj_fun.output_gaussian_noise(X)
6565
```
6666

6767
## Author
68-
* [Jungtaek Kim](http://jungtaek.github.io) (POSTECH)
69-
70-
## Contact
71-
* Jungtaek Kim: [[email protected]](mailto:[email protected])
68+
* [Jungtaek Kim](https://jungtaek.github.io) (POSTECH)
7269

7370
## License
7471
[MIT License](LICENSE)

bayeso_benchmarks/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#
22
# author: Jungtaek Kim ([email protected])
3-
# last updated: June 24, 2021
3+
# last updated: October 23, 2021
44
#
55

6-
__version__ = '0.1.5'
6+
7+
__version__ = '0.1.6'
78

89

910
from bayeso_benchmarks.inf_dim_ackley import Ackley
@@ -24,6 +25,9 @@
2425
from bayeso_benchmarks.two_dim_eggholder import Eggholder
2526
from bayeso_benchmarks.two_dim_goldsteinprice import GoldsteinPrice
2627
from bayeso_benchmarks.two_dim_holdertable import HolderTable
28+
from bayeso_benchmarks.two_dim_kim1 import Kim1
29+
from bayeso_benchmarks.two_dim_kim2 import Kim2
30+
from bayeso_benchmarks.two_dim_kim3 import Kim3
2731
from bayeso_benchmarks.two_dim_michalewicz import Michalewicz
2832
from bayeso_benchmarks.two_dim_sixhumpcamel import SixHumpCamel
2933
from bayeso_benchmarks.two_dim_threehumpcamel import ThreeHumpCamel

bayeso_benchmarks/benchmark_base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ def function(self, bx):
7474
def _output(self, X):
7575
assert isinstance(X, np.ndarray)
7676

77+
bounds = self.get_bounds()
78+
79+
assert np.all(X >= bounds[:, 0])
80+
assert np.all(X <= bounds[:, 1])
81+
7782
if len(X.shape) == 2:
7883
list_results = [self.function(bx) for bx in X]
7984
else:
@@ -220,6 +225,6 @@ def sample_uniform(self, num_points, seed=None):
220225
bounds = self.get_bounds()
221226

222227
points = random_state_.uniform(size=(num_points, dim_problem))
223-
points = (bounds[:, 0] + (bounds[:, 1] - bounds[:, 0])) * points
228+
points = bounds[:, 0] + (bounds[:, 1] - bounds[:, 0]) * points
224229

225230
return points

bayeso_benchmarks/inf_dim_ackley.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,7 @@ def __init__(self, dim_problem, seed=None):
4040

4141
function = lambda bx: fun_target(bx, dim_problem)
4242

43-
Function.__init__(self, dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed)
43+
try:
44+
super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed)
45+
except:
46+
super(Ackley, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed)

bayeso_benchmarks/inf_dim_cosines.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,7 @@ def __init__(self, dim_problem, seed=None):
3333

3434
function = lambda bx: fun_target(bx, dim_problem)
3535

36-
Function.__init__(self, dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed)
36+
try:
37+
super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed)
38+
except:
39+
super(Cosines, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed)

bayeso_benchmarks/inf_dim_rosenbrock.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,7 @@ def __init__(self, dim_problem, seed=None):
3737

3838
function = lambda bx: fun_target(bx, dim_problem)
3939

40-
Function.__init__(self, dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed)
40+
try:
41+
super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed)
42+
except:
43+
super(Rosenbrock, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed)

bayeso_benchmarks/inf_dim_sphere.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,7 @@ def __init__(self, dim_problem, seed=None):
3636

3737
function = lambda bx: fun_target(bx, dim_problem)
3838

39-
Function.__init__(self, dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed)
39+
try:
40+
super().__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed)
41+
except:
42+
super(Sphere, self).__init__(dim_bx, bounds, global_minimizers, global_minimum, function, dim_problem=dim_problem, seed=seed)

0 commit comments

Comments
 (0)