hibou.nn.tune_default_model#
- hibou.nn.default_model_tuner(train_dataset: DatasetV2, input_shape: Iterable[int], *, epochs: int = 500, max_trials: int = 50, project_name: str = 'untitled_project', validation_data: DatasetV2 = None)#
This function create a tuner for the default model and tune the following hyperparameters by minimizing the mean squared root with the
keras_tuner.BayesianOptimizationalgorithm:the number of Dense layers (between 1 and 5)
the activations functions (one per layer)
the number of units per layer (between 2 and 100)
the learning rate of the Dropout layer
the learning rate of the optimizer (AdamW with amsgrad)
This function will display the best hyperparameters found and the call to
default_modelis saved it into the filebest_hp_{project_name}.txt.Parameters#
- train_dataset
tf.data.Dataset The dataset to be used for tuning.
- input_shape
Iterable[int] The shape of the input layer.
- epochs
int, optionnal, keyword-only By default:
500. The number of epochs for each trials.- max_trials
int, optionnal, keyword-only By default:
50. The maximum number of trials to do before stop.- project_name
str, optionnal, keyword-only By default:
"untitled_project". The name of the project. It will influence the directory of the output (keras_tuner/{project_name}) and the name of the file that will contain the best hyperparameters.- validation_data
tf.data.Dataset, optionnal By default:
None. TheDatasetto be used for validation. By default, there is no validation.See also
hibou.utils.get_validation_from training