Skip to content

Commit b842d0d

Browse files
committed
dev updates
1 parent d7d0ded commit b842d0d

File tree

5 files changed

+72
-64
lines changed

5 files changed

+72
-64
lines changed

docs/honegumi.html

+54-54
Large diffs are not rendered by default.

docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Honegumi ([骨組み](https://translate.google.com/?sl=ja&tl=en&text=%E9%AA%A8%E
3333
Use Honegumi with ChatGPT to create non-halucinatory, custom Bayesian optimization scripts. See below for more info.
3434
```
3535

36-
LLMs are good at recognizing patterns but really bad at suggesting Bayesian optimization scripts from scratch. Since Honegumi is really good at programatically giving valid Bayes opt scripts, you can use Honegumi to get a template and then ask an LLM to adapt it to your use case. The two-minute video below shows how a Honegumi template can be adapted using GPT-4 to a cookie taste optimization as a function of flour, sugar, and butter content.
36+
LLMs are good at recognizing patterns but really bad at suggesting Bayesian optimization scripts from scratch. Since Honegumi is really good at programatically giving valid Bayes opt scripts, you can use Honegumi to get a template and then ask an LLM to adapt it to your use case. The two-minute video below shows how a Honegumi template can be adapted using an LLM (in our case, ChatGPT Plus) to a cookie taste optimization as a function of flour, sugar, and butter content.
3737

3838
<iframe width="560" height="315" src="https://www.youtube.com/embed/rnI2BvGgP9o?si=HGODRbP19MlkC662" title="YouTube video player" frameborder="0" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
3939

scripts/generate_scripts.py

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import io
2+
import json
23
import os
34
from itertools import product
45
from os import path
56
from pathlib import Path
6-
from urllib.parse import urljoin
7+
from urllib.parse import quote, urljoin
78

8-
import json
99
import jupytext
1010
import pandas as pd
1111
import pytest
@@ -133,7 +133,8 @@
133133
"tooltip": tooltips["synchrony"],
134134
"hidden": False,
135135
},
136-
# TODO: Single vs. Batch vs. Asynchronous Optimization, e.g., get_next_trial() vs. get_next_trials() # noqa E501 # NOTE: AC Microcourses
136+
# TODO: Single vs. Batch vs. Asynchronous Optimization, e.g., get_next_trial() vs. get_next_trials() # NOTE: AC Microcourses # noqa E501
137+
# TODO: Consider adding "human-in-the-loop" toggle, or something else related to start/stop or blocking to wait for human input # noqa E501 # NOTE: AC Microcourses
137138
]
138139

139140
# E.g.,
@@ -326,8 +327,13 @@ def is_incompatible(opt):
326327
"https://colab.research.google.com/github/sgbaird/honegumi/blob/main/"
327328
)
328329

329-
notebook_path = path.join(GEN_NOTEBOOK_DIR, f"{rendered_template_stem}.ipynb")
330-
colab_link = urljoin(colab_prefix, notebook_path)
330+
notebook_fname = f"{rendered_template_stem}.ipynb"
331+
notebook_path = path.join(GEN_NOTEBOOK_DIR, notebook_fname)
332+
# HACK: issue with + encoding becoming %20 instead of %2B due to use of \\,
333+
# and maybe other issues (hence both quote fn and replace line)
334+
encoded_notebook_fname = quote(notebook_fname)
335+
encoded_notebook_path = path.join(GEN_NOTEBOOK_DIR, encoded_notebook_fname)
336+
colab_link = urljoin(colab_prefix, encoded_notebook_path).replace("\\", "/")
331337
colab_badge = f'<a href="{colab_link}"><img alt="Open In Colab" src="https://colab.research.google.com/assets/colab-badge.svg"></a>' # noqa E501
332338

333339
preamble = f"{colab_badge} {github_badge}"

setup.cfg

-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ exclude =
7373
# Add here developer requirements (semicolon/line-separated)
7474
dev =
7575
setuptools
76-
pytest
7776
pytest-cov
7877
black[jupyter]
7978
mypy

tests/test_capstd.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
def test_simple():
2-
from ax.service.ax_client import AxClient
2+
from ax.service.ax_client import AxClient, ObjectiveProperties
33
from ax.utils.measurement.synthetic_functions import branin
44

5+
obj1_name = "branin"
6+
57
ax_client = AxClient()
68
ax_client.create_experiment(
79
parameters=[
810
{"name": "x1", "type": "range", "bounds": [-5.0, 10.0]},
911
{"name": "x2", "type": "range", "bounds": [0.0, 10.0]},
1012
],
11-
objective_name="branin",
12-
minimize=True,
13+
objectives={
14+
obj1_name: ObjectiveProperties(minimize=True),
15+
},
1316
)
1417

1518
for _ in range(15):

0 commit comments

Comments
 (0)