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.BayesianOptimization algorithm:

  • 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_model is saved it into the file best_hp_{project_name}.txt.

Parameters#

train_datasettf.data.Dataset

The dataset to be used for tuning.

input_shapeIterable[int]

The shape of the input layer.

epochsint, optionnal, keyword-only

By default: 500. The number of epochs for each trials.

max_trialsint, optionnal, keyword-only

By default: 50. The maximum number of trials to do before stop.

project_namestr, 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_datatf.data.Dataset, optionnal

By default: None. The Dataset to be used for validation. By default, there is no validation.

See also

hibou.utils.get_validation_from training