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

Numeric and Log-Scale Choice #306

Closed
wistuba opened this issue Aug 7, 2022 · 10 comments
Closed

Numeric and Log-Scale Choice #306

wistuba opened this issue Aug 7, 2022 · 10 comments
Labels
enhancement New feature or request

Comments

@wistuba
Copy link
Collaborator

wistuba commented Aug 7, 2022

There is no equivalent of choice for numeric values. E.g., in the FCNet blackbox the learning rate is defined as 'hp_init_lr': choice([0.0005, 0.001, 0.005, 0.01, 0.05, 0.1]). This will not allow model-based approaches to encode this hyperparameter correctly. Would be great to identify them as numeric and also indicate whether log transform is needed.

@wistuba wistuba added the enhancement New feature or request label Aug 7, 2022
@geoalgo
Copy link
Contributor

geoalgo commented Aug 10, 2022

We have an equivalent that works for regular ranges (e.g. [0.0005, 0.001, 0.002, 0.004]), since finrange and logfinrange allows to encodes finite value ranges correctly.

What is not supported is non regular range (as the one you give as an example). That being said, it is also not clear to me how frequent will that use-case be and how impactful it would be in term of final performance.

@mseeger
Copy link
Collaborator

mseeger commented Aug 15, 2022

Hi guys, with the forthcoming PR on DEHB, I'll also introduce an "ordinal" type which provides what Martin is asking for. This will be choice, but with an integer encoding internally. I can also split this out if that is simpler.

@mseeger
Copy link
Collaborator

mseeger commented Aug 15, 2022

However, "ordinal" will not support a log transform. For that, please use logfinrange and use a regular stepsize in log domain.

@mseeger
Copy link
Collaborator

mseeger commented Aug 15, 2022

Actually, this is already in there: #277 . Martin, let me know if this is what you need.

@mseeger
Copy link
Collaborator

mseeger commented Aug 15, 2022

To be clear: ordinal([0.0005, 0.001, 0.005, 0.01, 0.05, 0.1]) uses an int encoding (0 to 5), but this is not aware of numerical values,

@wistuba
Copy link
Collaborator Author

wistuba commented Aug 15, 2022

I would still need the original values. how about choice where we can set int or log?

@mseeger
Copy link
Collaborator

mseeger commented Aug 15, 2022

Hmm. ordinal is really just mapping the list of values (say: ['A', 'B', 'C']) to int (say, [0, 1, 2]), the values do not have to be numbers.

Maybe Martin has something more intesting in mind, in which case maybe he wants to change 'ordinal' in the first place?

@wistuba
Copy link
Collaborator Author

wistuba commented Aug 15, 2022

I simply want to get the same hyperparameter representation for choice([0.0005, 0.001, 0.005, 0.01, 0.05, 0.1]) as for log_uniform(0.0005, 0.1).

@mseeger
Copy link
Collaborator

mseeger commented Aug 15, 2022

I think what you have in mind is something like [0, 1] is partitioned into 6 intervals of different sizes (even after log transform). Sampling is from U[0,1], and you map it to a value by checking in which interval you land.

This is not supported right now, at least not for arbitrary increasing values.

@wistuba
Copy link
Collaborator Author

wistuba commented Aug 17, 2022

this wouldn't work with surrogate benchmarks, would it?

@aaronkl aaronkl closed this as not planned Won't fix, can't repro, duplicate, stale Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants