Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from jungtaekkim/0.1.6
0.1.6
- Loading branch information
Showing
61 changed files
with
638 additions
and
61 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: pytest | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
python-version: | ||
- '3.6' | ||
- '3.7' | ||
- '3.8' | ||
- '3.9' | ||
- '3.10' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools | ||
pip install pytest | ||
pip install scipy | ||
- name: Run pytest | ||
run: | | ||
pip install . | ||
pytest |
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# | ||
# author: Jungtaek Kim (jtkim@postech.ac.kr) | ||
# last updated: October 27, 2021 | ||
# | ||
|
||
import numpy as np | ||
|
||
from bayeso_benchmarks.benchmark_base import Function | ||
|
||
|
||
def fun_target(bx, dim_bx): | ||
assert len(bx.shape) == 1 | ||
assert bx.shape[0] == dim_bx | ||
|
||
y = np.sin(bx[0]) + np.cos(bx[1]) + 0.016 * (bx[0] - 5.0)**2 + 0.008 * (bx[1] - 5.0)**2 | ||
return y | ||
|
||
|
||
class Kim1(Function): | ||
def __init__(self, seed=None): | ||
assert isinstance(seed, (type(None), int)) | ||
|
||
dim_bx = 2 | ||
bounds = np.array([ | ||
[-16.0, 16.0], | ||
[-16.0, 16.0], | ||
]) | ||
global_minimizers = np.array([ | ||
[4.72130726, 3.17086303], | ||
]) | ||
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) |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# | ||
# author: Jungtaek Kim (jtkim@postech.ac.kr) | ||
# last updated: October 27, 2021 | ||
# | ||
|
||
import numpy as np | ||
|
||
from bayeso_benchmarks.benchmark_base import Function | ||
|
||
|
||
def fun_target(bx, dim_bx): | ||
assert len(bx.shape) == 1 | ||
assert bx.shape[0] == dim_bx | ||
|
||
y = np.sin(bx[0] / 1.0) + np.cos(bx[1] / 1.0) \ | ||
+ np.sin(bx[0] / 2.0) + np.cos(bx[1] / 2.0) \ | ||
+ np.sin(bx[0] / 4.0) + np.cos(bx[1] / 4.0) \ | ||
+ np.sin(bx[0] / 8.0) + np.cos(bx[1] / 8.0) \ | ||
+ np.sin(bx[0] / 16.0) + np.cos(bx[1] / 16.0) \ | ||
+ 0.0032 * (bx[0] - 20.0)**2 + 0.0016 * (bx[1] - 20.0)**2 | ||
return y | ||
|
||
|
||
class Kim2(Function): | ||
def __init__(self, seed=None): | ||
assert isinstance(seed, (type(None), int)) | ||
|
||
dim_bx = 2 | ||
bounds = np.array([ | ||
[-128.0, 128.0], | ||
[-128.0, 128.0], | ||
]) | ||
global_minimizers = np.array([ | ||
[-2.1013466, 34.14526252], | ||
]) | ||
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) |
Oops, something went wrong.