From 845cd3b56bc1b63bef2fda2533df46945a00a461 Mon Sep 17 00:00:00 2001 From: Stanley F Date: Fri, 15 Mar 2024 07:14:54 +0100 Subject: [PATCH] change integer division to floating point division when calculating values of floating point hyperparameter --- keras_tuner/engine/hyperparameters/hp_types/numerical.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keras_tuner/engine/hyperparameters/hp_types/numerical.py b/keras_tuner/engine/hyperparameters/hp_types/numerical.py index 528d0c53a..5bb0287c0 100644 --- a/keras_tuner/engine/hyperparameters/hp_types/numerical.py +++ b/keras_tuner/engine/hyperparameters/hp_types/numerical.py @@ -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 (