Skip to content

Commit

Permalink
change integer division to floating point division when calculating v…
Browse files Browse the repository at this point in the history
…alues of floating point hyperparameter
  • Loading branch information
sfo committed Mar 20, 2024
1 parent d646209 commit 845cd3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion keras_tuner/engine/hyperparameters/hp_types/numerical.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def _get_n_values(self):
"""Get the total number of possible values using step."""
if self.sampling == "linear":
# +1 so that max_value may be sampled.
return int((self.max_value - self.min_value) // self.step + 1)
return int((self.max_value - self.min_value) / self.step + 1)
# For log and reverse_log
# +1 so that max_value may be sampled.
return (
Expand Down

0 comments on commit 845cd3b

Please sign in to comment.