ยป Keras API reference / KerasTuner / Oracles / RandomSearch Oracle

RandomSearch Oracle

RandomSearchOracle class

keras_tuner.oracles.RandomSearchOracle(
    objective,
    max_trials,
    seed=None,
    hyperparameters=None,
    allow_new_entries=True,
    tune_new_entries=True,
)

Random search oracle.

Arguments

  • objective: A string or keras_tuner.Objective instance. If a string, the direction of the optimization (min or max) will be inferred.
  • max_trials: Integer, the total number of trials (model configurations) to test at most. Note that the oracle may interrupt the search before max_trial models have been tested if the search space has been exhausted.
  • seed: Optional integer, the random seed.
  • hyperparameters: Optional HyperParameters instance. 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 hyperparameters should 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.