Skip to content

Commit 4b7b40e

Browse files
authored
Merge pull request #302 from nabenabe0928/refactor-carbo-doc
Support correct math style in markdown by adding `mdformat-myst` to formatter
2 parents bea87dc + 92dcdb0 commit 4b7b40e

File tree

4 files changed

+43
-41
lines changed

4 files changed

+43
-41
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ repos:
2323
- id: mdformat
2424
additional_dependencies:
2525
- mdformat-frontmatter
26+
- mdformat-myst
2627
# Ignore only the `README.md` for this repository and check the others in `packages`.
2728
exclude: ^(.github/|README.md)

package/benchmarks/bbob/README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -72,32 +72,32 @@ Please refer to [the paper](https://numbbo.github.io/gforge/downloads/download16
7272
1. Multi-modal functions with adequate global structure
7373
1. Multi-modal functions with weak global structure
7474

75-
| Category | Function ID | Function Name |
76-
|-----------|-------------|--------------------------------------------------------------------------------------------------------------------------|
77-
| 1 | 1 | [Sphere Function](https://coco-platform.org/testsuites/bbob/functions/f01.html) |
78-
| 1 | 2 | [Separable Ellipsoidal Function](https://coco-platform.org/testsuites/bbob/functions/f02.html) |
79-
| 1 | 3 | [Rastrigin Function](https://coco-platform.org/testsuites/bbob/functions/f03.html) |
80-
| 1 | 4 | [Büche-Rastrigin Function](https://coco-platform.org/testsuites/bbob/functions/f04.html) |
81-
| 1 | 5 | [Linear Slope](https://coco-platform.org/testsuites/bbob/functions/f05.html) |
82-
| 2 | 6 | [Attractive Sector Function](https://coco-platform.org/testsuites/bbob/functions/f06.html) |
83-
| 2 | 7 | [Step Ellipsoidal Function](https://coco-platform.org/testsuites/bbob/functions/f07.html) |
84-
| 2 | 8 | [Rosenbrock Function, original](https://coco-platform.org/testsuites/bbob/functions/f08.html) |
85-
| 2 | 9 | [Rosenbrock Function, rotated](https://coco-platform.org/testsuites/bbob/functions/f09.html) |
86-
| 3 | 10 | [Ellipsoidal Function](https://coco-platform.org/testsuites/bbob/functions/f10.html) |
87-
| 3 | 11 | [Discus Function](https://coco-platform.org/testsuites/bbob/functions/f11.html) |
88-
| 3 | 12 | [Bent Cigar Function](https://coco-platform.org/testsuites/bbob/functions/f12.html) |
89-
| 3 | 13 | [Sharp Ridge Function](https://coco-platform.org/testsuites/bbob/functions/f13.html) |
90-
| 3 | 14 | [Different Powers Function](https://coco-platform.org/testsuites/bbob/functions/f14.html) |
91-
| 4 | 15 | [Rastrigin Function](https://coco-platform.org/testsuites/bbob/functions/f15.html) |
92-
| 4 | 16 | [Weierstrass Function](https://coco-platform.org/testsuites/bbob/functions/f16.html) |
93-
| 4 | 17 | [Schaffer's F7 Function](https://coco-platform.org/testsuites/bbob/functions/f17.html) |
94-
| 4 | 18 | [Schaffer's F7 Function, moderately ill-conditioned](https://coco-platform.org/testsuites/bbob/functions/f18.html) |
95-
| 4 | 19 | [Composite Griewank-Rosenbrock Function F8F2](https://coco-platform.org/testsuites/bbob/functions/f19.html) |
96-
| 5 | 20 | [Schwefel Function](https://coco-platform.org/testsuites/bbob/functions/f20.html) |
97-
| 5 | 21 | [Gallagher's Gaussian 101-me Peaks Function](https://coco-platform.org/testsuites/bbob/functions/f21.html) |
98-
| 5 | 22 | [Gallagher's Gaussian 21-hi Peaks Function](https://coco-platform.org/testsuites/bbob/functions/f22.html) |
99-
| 5 | 23 | [Katsuura Function](https://coco-platform.org/testsuites/bbob/functions/f23.html) |
100-
| 5 | 24 | [Lunacek bi-Rastrigin Function](https://coco-platform.org/testsuites/bbob/functions/f24.html) |
75+
| Category | Function ID | Function Name |
76+
| -------- | ----------- | ------------------------------------------------------------------------------------------------------------------ |
77+
| 1 | 1 | [Sphere Function](https://coco-platform.org/testsuites/bbob/functions/f01.html) |
78+
| 1 | 2 | [Separable Ellipsoidal Function](https://coco-platform.org/testsuites/bbob/functions/f02.html) |
79+
| 1 | 3 | [Rastrigin Function](https://coco-platform.org/testsuites/bbob/functions/f03.html) |
80+
| 1 | 4 | [Büche-Rastrigin Function](https://coco-platform.org/testsuites/bbob/functions/f04.html) |
81+
| 1 | 5 | [Linear Slope](https://coco-platform.org/testsuites/bbob/functions/f05.html) |
82+
| 2 | 6 | [Attractive Sector Function](https://coco-platform.org/testsuites/bbob/functions/f06.html) |
83+
| 2 | 7 | [Step Ellipsoidal Function](https://coco-platform.org/testsuites/bbob/functions/f07.html) |
84+
| 2 | 8 | [Rosenbrock Function, original](https://coco-platform.org/testsuites/bbob/functions/f08.html) |
85+
| 2 | 9 | [Rosenbrock Function, rotated](https://coco-platform.org/testsuites/bbob/functions/f09.html) |
86+
| 3 | 10 | [Ellipsoidal Function](https://coco-platform.org/testsuites/bbob/functions/f10.html) |
87+
| 3 | 11 | [Discus Function](https://coco-platform.org/testsuites/bbob/functions/f11.html) |
88+
| 3 | 12 | [Bent Cigar Function](https://coco-platform.org/testsuites/bbob/functions/f12.html) |
89+
| 3 | 13 | [Sharp Ridge Function](https://coco-platform.org/testsuites/bbob/functions/f13.html) |
90+
| 3 | 14 | [Different Powers Function](https://coco-platform.org/testsuites/bbob/functions/f14.html) |
91+
| 4 | 15 | [Rastrigin Function](https://coco-platform.org/testsuites/bbob/functions/f15.html) |
92+
| 4 | 16 | [Weierstrass Function](https://coco-platform.org/testsuites/bbob/functions/f16.html) |
93+
| 4 | 17 | [Schaffer's F7 Function](https://coco-platform.org/testsuites/bbob/functions/f17.html) |
94+
| 4 | 18 | [Schaffer's F7 Function, moderately ill-conditioned](https://coco-platform.org/testsuites/bbob/functions/f18.html) |
95+
| 4 | 19 | [Composite Griewank-Rosenbrock Function F8F2](https://coco-platform.org/testsuites/bbob/functions/f19.html) |
96+
| 5 | 20 | [Schwefel Function](https://coco-platform.org/testsuites/bbob/functions/f20.html) |
97+
| 5 | 21 | [Gallagher's Gaussian 101-me Peaks Function](https://coco-platform.org/testsuites/bbob/functions/f21.html) |
98+
| 5 | 22 | [Gallagher's Gaussian 21-hi Peaks Function](https://coco-platform.org/testsuites/bbob/functions/f22.html) |
99+
| 5 | 23 | [Katsuura Function](https://coco-platform.org/testsuites/bbob/functions/f23.html) |
100+
| 5 | 24 | [Lunacek bi-Rastrigin Function](https://coco-platform.org/testsuites/bbob/functions/f24.html) |
101101

102102
![BBOB Plots](images/bbob.png)
103103

package/samplers/carbo/README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,30 +72,30 @@ Please look at [GitHub README.md](https://github.com/optuna/optunahub-registry/t
7272

7373
In this section, we use the following notations:
7474

75-
- $x \\in \[0, 1\]^D$, an input vector,
76-
- $B\_\\epsilon \\coloneqq \[-\\frac{\\epsilon}{2}, \\frac{\\epsilon}{2}\]^D$, an $\\epsilon$-bounding box,
77-
- $\\xi \\in B\_\\epsilon$, an input noise,
78-
- $f: \[0, 1\]^D \\rightarrow \\mathbb{R}$, an objective function,
79-
- $g_c: \[0, 1\]^D \\rightarrow \\mathbb{R}$, the $c$-th constraint,
80-
- $\\text{LCB}\_{h}: \[0, 1\]^D \\rightarrow \\mathbb{R}$, the lower confidence bound of a function $h$,
81-
- $\\text{UCB}\_{h}: \[0, 1\]^D \\rightarrow \\mathbb{R}$, the upper confidence bound of a function $h$.
75+
- $x \in [0, 1]^D$, an input vector,
76+
- $B_\epsilon \coloneqq [-\frac{\epsilon}{2}, \frac{\epsilon}{2}]^D$, an $\epsilon$-bounding box,
77+
- $\xi \in B_\epsilon$, an input noise,
78+
- $f: [0, 1]^D \rightarrow \mathbb{R}$, an objective function,
79+
- $g_c: [0, 1]^D \rightarrow \mathbb{R}$, the $c$-th constraint,
80+
- $\text{LCB}_{h}: [0, 1]^D \rightarrow \mathbb{R}$, the lower confidence bound of a function $h$,
81+
- $\text{UCB}_{h}: [0, 1]^D \rightarrow \mathbb{R}$, the upper confidence bound of a function $h$.
8282

8383
Please note that both $g_c$ and $f$ are standardized internally so that their distributions follow the assumption on the prior distribution by the Gaussian process.
8484

8585
Suppose we would like to solve the following max-min problem:
86-
$\\max\_{x \\in \[0, 1\]^D} \\min\_{\\xi \\in B\_\\epsilon} f(x + \\xi) \\text{ subject to } g_c(x + \\xi) \\geq 0 ; (\\text{for }c \\in {1, 2, \\dots, C}).$
87-
where the actual input noise $\\xi$ is assumed to be drawn from $B\_\\epsilon$ uniformly.
86+
$\max_{x \in [0, 1]^D} \min_{\xi \in B_\epsilon} f(x + \xi) \text{ subject to } g_c(x + \xi) \geq 0 \; (\text{for }c \in {1, 2, \dots, C}).$
87+
where the actual input noise $\xi$ is assumed to be drawn from $B_\epsilon$ uniformly.
8888

8989
### Algorithm Details
9090

91-
1. Train Gaussian process regressors for each function $f, g_1, \\dots, g_C$ using the past observations.
91+
1. Train Gaussian process regressors for each function $f, g_1, \dots, g_C$ using the past observations.
9292
1. Solve the following max-min problem:
93-
$x\_{\\star} \\in \\text{arg}\\max\_{x \\in \[0, 1\]^D}\\min\_{\\xi \\in B\_\\epsilon} \\text{UCB}_{f}(x + \\xi) + \\rho \\sum_{c = 1}^C \[\\text{UCB}\_{g_c}(x + \\xi)\]^{-}$ where $\[a\]^{-} \\coloneqq \\min(0, a)$.
93+
$x_{\star} \in \text{arg}\max_{x \in [0, 1]^D}\min_{\xi \in B_\epsilon} \text{UCB}_{f}(x + \xi) + \rho \sum_{c = 1}^C [\text{UCB}_{g_c}(x + \xi)]^{-}$ where $[a]^{-} \coloneqq \min(0, a)$.
9494
1. Solve the following minimization problem:
95-
$\\xi\_{\\star} \\in \\text{arg}\\min\_{\\xi \\in B\_\\epsilon} \\text{LCB}_{f}(x_\\star + \\xi) + \\rho\\sum\_{c = 1}^C \[\\text{LCB}_{g_c}(x_\\star + \\xi)\]^{-}$
96-
1. Evaluate each function at $x = x\_{\\star} + \\xi\_{\\star}$.
95+
$\xi_{\star} \in \text{arg}\min_{\xi \in B_\epsilon} \text{LCB}_{f}(x_\star + \xi) + \rho\sum_{c = 1}^C [\text{LCB}_{g_c}(x_\star + \xi)]^{-}$
96+
1. Evaluate each function at $x = x_{\star} + \xi_{\star}$.
9797
1. Go back to 1.
9898

99-
In principle, $\[\\text{UCB}_{g_c}(x + \\xi)\]^{-}$ and $\[\\text{LCB}_{g_c}(x + \\xi)\]^{-}$ quantify the upper and lower confidence bounds of the violation amount.
100-
Please note that Processes 2 and 3 are modified from the original paper because our setup assumes that the same input noise $\\xi$ is used for each constraint and the objective evaluations.
99+
In principle, $[\text{UCB}_{g_c}(x + \xi)]^{-}$ and $[\text{LCB}_{g_c}(x + \xi)]^{-}$ quantify the upper and lower confidence bounds of the violation amount.
100+
Please note that Processes 2 and 3 are modified from the original paper because our setup assumes that the same input noise $\xi$ is used for each constraint and the objective evaluations.
101101
Also, the order of the min or max operation and the summation is flipped in our implementation.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ checking = [
2222
"pre-commit",
2323
"ruff==0.3.5",
2424
"mdformat",
25+
"mdformat-myst",
2526
"mdformat-frontmatter",
2627
"mypy==1.9.0",
2728
"types-PyYAML",

0 commit comments

Comments
 (0)