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

Support linearize log integer properly #658

Merged
merged 1 commit into from
Sep 9, 2021

Conversation

bouthilx
Copy link
Member

@bouthilx bouthilx commented Sep 8, 2021

[Fixes #552]

Why:

A log integer dimension would be casted to real, linearized, then casted
back to integer. This reduces dramatically the number of possible values
that can be sampled as many exp(int(log(x))) will result in the same
integer for many different values of x. An algorithm that needs
linearization should be able to handle real space or otherwise state a
requirement for integers. This should be handled separately and
quantization of linearized log integer should not be applied by default.

Note:

Due to the use of floor instead of rounding in Quantize, the values of
int(exp(log(x))) would still clash for close values of x. Using rounding
instead solves the issue. Rounding may be problematic however for
algorithms that require integer type, as the rounding may cast real
integers to values that are out-of-bound. For now there are no
foreseeable algorithms that may require integer type so I avoid fixing
the issue and leave it for later if the need even arises (which I highly
doubt).

Why:

A log integer dimension would be casted to real, linearized, then casted
back to integer. This reduces dramatically the number of possible values
that can be sampled as many exp(int(log(x))) will result in the same
integer for many different values of x. An algorithm that needs
linearization should be able to handle real space or otherwise state a
requirement for integers. This should be handled separately and
quantization of linearized log integer should not be applied by default.

Note:

Due to the use of floor instead of rounding in Quantize, the values of
int(exp(log(x))) would still clash for close values of x. Using rounding
instead solves the issue. Rounding may be problematic however for
algorithms that require integer type, as the rounding may cast real
integers to values that are out-of-bound. For now there are no
foreseeable algorithms that may require integer type so I avoid fixing
the issue and leave it for later if the need even arises (which I highly
doubt).
@bouthilx bouthilx added the bug Indicates an unexpected problem or unintended behavior label Sep 8, 2021
@bouthilx bouthilx added this to the v0.1.17 milestone Sep 8, 2021
@bouthilx bouthilx merged commit 5de01a9 into Epistimio:develop Sep 9, 2021
@bouthilx bouthilx deleted the hotfix/out_of_bound_log_int branch September 9, 2021 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linearized discrete loguniform dimensions lead to out of bound values
1 participant