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

Contrary to documentation, floating point hyperparameter does not include max_value #1001

Open
sfo opened this issue Mar 15, 2024 · 0 comments · May be fixed by #1002
Open

Contrary to documentation, floating point hyperparameter does not include max_value #1001

sfo opened this issue Mar 15, 2024 · 0 comments · May be fixed by #1002

Comments

@sfo
Copy link
Contributor

sfo commented Mar 15, 2024

I realized that for this snippet:

import keras_tuner

keras_tuner.__version__

hp = keras_tuner.HyperParameters()
min = .2
max = .6
step = 0.2
hp.Float("dropout_rate", min, max, step)
print("This should print 3 values:", list(hp.space[0].values))

I get

'1.4.7'
This should print 3 values: [0.2, 0.4]

The root cause seems to be the division at:

return int((self.max_value - self.min_value) // self.step + 1)

I'd suggest to replace the integer division by a floating point division and would be willing to contribute a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant