Skip to content

Commit

Permalink
Move static folder (#485)
Browse files Browse the repository at this point in the history
* moving static folder into docsrc; fixes #467

* moving static folder into docsrc; fixes #467

* upating build docs job, and hacking together the movement of static..

* fix pyproject.toml file (duplicated dependency

* use poetry env to build docs

* Update build_docs.yml

* Update docsrc/Makefile

Co-authored-by: till-m <36440677+till-m@users.noreply.github.com>

---------

Co-authored-by: till-m <36440677+till-m@users.noreply.github.com>
  • Loading branch information
bwheelz36 and till-m authored Jun 30, 2024
1 parent 4aa6a97 commit f2c720e
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 23 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,15 @@ jobs:
python-version: '3.10'
- name: Install pandoc
run: sudo apt-get install -y pandoc
- name: Install dependencies
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install package and test dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx
pip install nbsphinx
pip install sphinx_rtd_theme
pip install jupyter
pip install myst-parser
- name: Install package
run: |
pip install -e .
poetry install --with dev,nbtools
- name: build sphinx docs
run: |
cd docsrc
make github
poetry run make github
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/master' }}
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ for ideas on how to implement bayesian optimization in a distributed fashion usi

Bayesian optimization works by constructing a posterior distribution of functions (gaussian process) that best describes the function you want to optimize. As the number of observations grows, the posterior distribution improves, and the algorithm becomes more certain of which regions in parameter space are worth exploring and which are not, as seen in the picture below.

![BayesianOptimization in action](./static/bo_example.png)
![BayesianOptimization in action](docsrc/static/bo_example.png)

As you iterate over and over, the algorithm balances its needs of exploration and exploitation taking into account what it knows about the target function. At each step a Gaussian Process is fitted to the known samples (points previously explored), and the posterior distribution, combined with a exploration strategy (such as UCB (Upper Confidence Bound), or EI (Expected Improvement)), are used to determine the next point that should be explored (see the gif below).

![BayesianOptimization in action](./static/bayesian_optimization.gif)
![BayesianOptimization in action](docsrc/static/bayesian_optimization.gif)

This process is designed to minimize the number of steps required to find a combination of parameters that are close to the optimal combination. To do so, this method uses a proxy optimization problem (finding the maximum of the acquisition function) that, albeit still a hard problem, is cheaper (in the computational sense) and common tools can be employed. Therefore Bayesian Optimization is most adequate for situations where sampling the function to be optimized is a very expensive endeavor. See the references for a proper discussion of this method.

Expand Down Expand Up @@ -183,7 +183,7 @@ Sometimes the initial boundaries specified for a problem are too wide, and addin

When it's worthwhile to converge on an optimal point quickly rather than try to find the optimal point, contracting the domain around the current optimal value as the search progresses can speed up the search progress considerably. Using the `SequentialDomainReductionTransformer` the bounds of the problem can be panned and zoomed dynamically in an attempt to improve convergence.

![sequential domain reduction](./static/sdr.png)
![sequential domain reduction](docsrc/static/sdr.png)

An example of using the `SequentialDomainReductionTransformer` is shown in the [domain reduction notebook](http://bayesian-optimization.github.io/BayesianOptimization/domain_reduction.html). More information about this method can be found in the paper ["On the robustness of a simple domain reduction scheme for simulation‐based optimization"](http://www.truegrid.com/srsm_revised.pdf).

Expand Down
4 changes: 2 additions & 2 deletions docsrc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ BUILDDIR = ../docs
.PHONY: help Makefile

github:
@cp ../README.md .
@cp -r ../static .
# @cp ../README.md .
@make html
@cp -a ../docs/html/. ../docs
@cp -r ../docsrc/ ../docs

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
Expand Down
2 changes: 1 addition & 1 deletion docsrc/quickstart.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.. include:: README.md
.. include:: ../README.md
:parser: myst_parser.sphinx_
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
6 changes: 3 additions & 3 deletions examples/advanced-tour.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@
"source": [
"### 3.3 Changing kernels\n",
"\n",
"By default this package uses the Matern 2.5 kernel. Depending on your use case you may find that tunning the GP kernel could be beneficial. You're on your own here since these are very specific solutions to very specific problems."
"By default this package uses the Matern 2.5 kernel. Depending on your use case you may find that tunning the GP kernel could be beneficial. You're on your own here since these are very specific solutions to very specific problems. You should start with the [scikit learn docs](https://scikit-learn.org/stable/modules/gaussian_process.html#kernels-for-gaussian-processes)"
]
},
{
Expand Down Expand Up @@ -504,9 +504,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.5"
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
6 changes: 3 additions & 3 deletions examples/domain_reduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"\n",
"**Zoom**: contract the region of interest.\n",
"\n",
"![](../static/sdr.png)\n",
"![](../docsrc/static/sdr.png)\n",
"\n",
"\n",
"## Parameters\n",
Expand Down Expand Up @@ -298,9 +298,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ nbformat = "^5.9.2"
nbconvert = "^7.14.2"
jupyter = "^1.0.0"
matplotlib = "^3.0"
sphinx = "^7.3.7"
nbsphinx = "^0.9.4"
sphinx-rtd-theme = "^2.0.0"
myst-parser = "^3.0.1"


[build-system]
Expand Down

0 comments on commit f2c720e

Please sign in to comment.