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

Create TruncatedNormalHyperparameter #302

Open
mfeurer opened this issue Feb 24, 2023 · 2 comments · May be fixed by #346
Open

Create TruncatedNormalHyperparameter #302

mfeurer opened this issue Feb 24, 2023 · 2 comments · May be fixed by #346

Comments

@mfeurer
Copy link
Contributor

mfeurer commented Feb 24, 2023

To decouple the code for bounded and unbounded normal hyperparameters.

@eddiebergman
Copy link
Contributor

eddiebergman commented Apr 27, 2023

@Neonkraft

The initial reaction was to have a heirarchy of NormalFloatHyperparameter -> TruncatedNormalHyperparameter but then checking for a non-truncated Normal becomes tedious.

x = NormalFloatHyperparameter(...)
y = TruncatedNormalFloatHyperparameter(...)

items = [x, y, ...]  # Some other hyperparameter types
for item in items:
    if isinstance(item, NormalFloatHyperparameter):
        ... # This would match both x and y

The correct solution would then be:

if isinstance(item, NormalFloatHyperparameter) and not isinstance(item, TruncatedNormalFloatHyperparameter):
    ... # This is the only way to match just x

I'm okay with some minor code duplication to keep these seperated, otherwise we need some _private superclass, which just makes the heirarchy of hyperparameters more complex.


This would also constitute a pretty major breaking change and a version bump. This should probably be done at the same time as doing so for Uniform and possible Beta params

@eddiebergman
Copy link
Contributor

We'll no longer have unbounded hyperparameters in #346 so that all hyperparameters are have explicit bounds.

@eddiebergman eddiebergman linked a pull request Apr 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants