keras-tuner
keras-tuner copied to clipboard
BayesianOptimization tuner num_initial_points argument defaults to 2 if not specified
Describe the bug
BayesianOptimization tuner num_initial_points argument defaults to 2 if not specified. The description at https://keras.io/api/keras_tuner/tuners/bayesian/ states "If left unspecified, a value of 3 times the dimensionality of the hyperparameter space is used." which doesn't seem to be the case.
To Reproduce
You should be able to use the code at https://keras.io/guides/keras_tuner/getting_started/ (my code is similar) In the example, the search space size is 5 so num_initial_points should be 15 since it is not specified. The oracle.json file in the project folder still shows num_initial_points=2.
Expected behavior
If left unspecified, a value of 3 times the dimensionality of the hyperparameter space is used.
Additional context
Would you like to help us fix it?
I think that you should set num_initial_points by yourself,and I think the bug should be fixed I try to add these code after the 243line in the "bayesian.py": num_initial_points = self.num_initial_points or 3 * dimensions ###(the origin code) print(num_initial_points) ###this is what I added and finally it prints"2" @haifeng-jin I don't if i did this correctly, I am new in github.Hope you can look at this
The documentation should be changed. We it is always defaults to 2.
The file to be changed: https://github.com/keras-team/keras-tuner/blob/1.1.3/keras_tuner/tuners/bayesian.py#L218