GridSearch Oracle
- Original Link : https://keras.io/api/keras_tuner/oracles/grid/
- Last Checked at : 2024-11-25
GridSearchOracle class
keras_tuner.oracles.GridSearchOracle(
objective=None,
max_trials=None,
seed=None,
hyperparameters=None,
allow_new_entries=True,
tune_new_entries=True,
max_retries_per_trial=0,
max_consecutive_failed_trials=3,
)Grid search oracle.
Arguments
- objective: A string,
keras_tuner.Objectiveinstance, or a list ofkeras_tuner.Objectives and strings. If a string, the direction of the optimization (min or max) will be inferred. If a list ofkeras_tuner.Objective, we will minimize the sum of all the objectives to minimize subtracting the sum of all the objectives to maximize. Theobjectiveargument is optional whenTuner.run_trial()orHyperModel.fit()returns a single float as the objective to minimize. - max_trials: Optional integer, the total number of trials (model
configurations) to test at most. Note that the oracle may interrupt
the search before
max_trialmodels have been tested if the search space has been exhausted. If left unspecified, it runs till the search space is exhausted. - seed: Optional integer, the random seed.
- hyperparameters: Optional
HyperParametersinstance. Can be used to override (or register in advance) hyperparameters in the search space. - tune_new_entries: Boolean, whether hyperparameter entries that are
requested by the hypermodel but that were not specified in
hyperparametersshould be added to the search space, or not. If not, then the default value for these parameters will be used. Defaults to True. - allow_new_entries: Boolean, whether the hypermodel is allowed to
request hyperparameter entries not listed in
hyperparameters. Defaults to True. - max_retries_per_trial: Integer. Defaults to 0. The maximum number of
times to retry a
Trialif the trial crashed or the results are invalid. - max_consecutive_failed_trials: Integer. Defaults to 3. The maximum
number of consecutive failed
Trials. When this number is reached, the search will be stopped. ATrialis marked as failed when none of the retries succeeded.