Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Automatic streamlining of configuration space #741

Merged
merged 4 commits into from
Aug 3, 2023
Merged

Conversation

mseeger
Copy link
Collaborator

@mseeger mseeger commented Jul 8, 2023

This is automating some best practices for choosing domains in config_space. Particularly useful for people who come from other tools, like Optuna, where you don't have the finite numerical types we have.

Closes #380.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@mseeger mseeger requested a review from aaronkl July 8, 2023 17:24
@@ -57,8 +63,8 @@


_config_space = {
NUM_UNITS_1: randint(4, 1024),
NUM_UNITS_2: randint(4, 1024),
NUM_UNITS_1: lograndint(4, 1024),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made this change, because our own replacement logic maps randint to lograndint when upper >= 100 * lower.

@codecov
Copy link

codecov bot commented Jul 8, 2023

Codecov Report

Patch coverage: 96.34% and project coverage change: +0.18% 🎉

Comparison is base (04a3db1) 64.04% compared to head (d48c63c) 64.22%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #741      +/-   ##
==========================================
+ Coverage   64.04%   64.22%   +0.18%     
==========================================
  Files         433      435       +2     
  Lines       28952    29034      +82     
==========================================
+ Hits        18542    18648     +106     
+ Misses      10410    10386      -24     
Files Changed Coverage Δ
...benchmark_definitions/finetune_transformer_swag.py 0.00% <ø> (ø)
syne_tune/utils/convert_domain.py 95.77% <95.77%> (ø)
syne_tune/util.py 73.43% <100.00%> (+0.42%) ⬆️
syne_tune/utils/__init__.py 100.00% <100.00%> (+100.00%) ⬆️
tst/test_convert_domain.py 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

docs/source/search_space.rst Outdated Show resolved Hide resolved
syne_tune/utils/convert_domain.py Show resolved Hide resolved

def fit_to_regular_grid(x: np.ndarray) -> Dict[str, float]:
r"""
Computes the least squares fit of :math:`a * j + b` to ``x[j]``, where
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is x[j] here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The j-th entry of array x

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but what does it corresponds to? A single hyperparameter in the config space?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a subroutine. It is called with the sorted values for one numerical choice variable, or with the log of these. The docs of convert_domain explain that.

syne_tune/utils/convert_domain.py Show resolved Hide resolved
@mseeger mseeger merged commit c35686e into main Aug 3, 2023
32 checks passed
@mseeger mseeger deleted the auto_domain branch August 3, 2023 12:57
@wesk wesk added the feature label Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto-suggest domains with better encoding
3 participants