class_docstr: Grid search oracle.
  
  Args:
      objective: A string, `keras_tuner.Objective` instance, or a list of
          `keras_tuner.Objective`s and strings. If a string, the direction of
          the optimization (min or max) will be inferred. If a list of
          `keras_tuner.Objective`, we will minimize the sum of all the
          objectives to minimize subtracting the sum of all the objectives to
          maximize. The `objective` argument is optional when
          `Tuner.run_trial()` or `HyperModel.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_trial` models 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 `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.
      max_retries_per_trial: Integer. Defaults to 0. The maximum number of
          times to retry a `Trial` if the trial crashed or the results are
          invalid.
      max_consecutive_failed_trials: Integer. Defaults to 3. The maximum
          number of consecutive failed `Trial`s. When this number is reached,
          the search will be stopped. A `Trial` is marked as failed when none
          of the retries succeeded.
class_docstr_tok: ["Grid","search","oracle",".","Args",":","objective",":","A","string",",","`","keras_tuner.Objective","`","instance",",","or","a","list","of","`","keras_tuner.Objective","`","s","and","strings",".","If","a","string",",","the","direction","of","the","optimization","(","min","or","max",")","will","be","inferred",".","If","a","list","of","`","keras_tuner.Objective","`",",","we","will","minimize","the","sum","of","all","the","objectives","to","minimize","subtracting","the","sum","of","all","the","objectives","to","maximize",".","The","`","objective","`","argument","is","optional","when","`","Tuner.run_trial","(",")","`","or","`","HyperModel.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_trial","`","models","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","`","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",".","max_retries_per_trial",":","Integer",".","Defaults","to","0",".","The","maximum","number","of","times","to","retry","a","`","Trial","`","if","the","trial","crashed","or","the","results","are","invalid",".","max_consecutive_failed_trials",":","Integer",".","Defaults","to","3",".","The","maximum","number","of","consecutive","failed","`","Trial","`","s",".","When","this","number","is","reached",",","the","search","will","be","stopped",".","A","`","Trial","`","is","marked","as","failed","when","none","of","the","retries","succeeded","."]
docstr: Get the next value combination to try.
  
  Given the last trial's values dictionary, this method retrieves the next
  hyperparameter values to try. As it requires the last trial's
  values as input, it should not be called on the first trial. The first
  trial will always use default hp values.
  
  This oracle iterates over the search space entirely deterministically.
  
  When a new hp appears in a trial, the first value tried for that hp
  will be its default value.
  
  Args:
      values: Dict. The keys are hp names. The values are the hp values
          from the last trial.
  
  Returns:
      Dict or None. The next possible value combination for the
      hyperparameters. If no next combination exist (values is the last
      combination), it returns None. The return values only include the
      active ones.
docstr_tok: ["Get","the","next","value","combination","to","try",".","Given","the","last","trial","'s","values","dictionary",",","this","method","retrieves","the","next","hyperparameter","values","to","try",".","As","it","requires","the","last","trial's","values","as","input",",","it","should","not","be","called","on","the","first","trial",".","The","first","trial","will","always","use","default","hp","values",".","This","oracle","iterates","over","the","search","space","entirely","deterministically",".","When","a","new","hp","appears","in","a","trial",",","the","first","value","tried","for","that","hp","will","be","its","default","value",".","Args",":","values",":","Dict",".","The","keys","are","hp","names",".","The","values","are","the","hp","values","from","the","last","trial",".","Returns",":","Dict","or","None",".","The","next","possible","value","combination","for","the","hyperparameters",".","If","no","next","combination","exist","(","values","is","the","last","combination",")",",","it","returns","None",".","The","return","values","only","include","the","active","ones","."]
code: def _get_next_combination(self, values):
      """Get the next value combination to try.
  
      Given the last trial's values dictionary, this method retrieves the next
      hyperparameter values to try. As it requires the last trial's
      values as input, it should not be called on the first trial. The first
      trial will always use default hp values.
  
      This oracle iterates over the search space entirely deterministically.
  
      When a new hp appears in a trial, the first value tried for that hp
      will be its default value.
  
      Args:
          values: Dict. The keys are hp names. The values are the hp values
              from the last trial.
  
      Returns:
          Dict or None. The next possible value combination for the
          hyperparameters. If no next combination exist (values is the last
          combination), it returns None. The return values only include the
          active ones.
      """
  
      hps = self.get_space()
      all_values = {}
      for hp in hps.space:
          value_list = list(hp.values)
          if hp.default in value_list:
              value_list.remove(hp.default)
          # Put the default value first.
          all_values[hp.name] = [hp.default] + value_list
      default_values = {hp.name: hp.default for hp in hps.space}
      hps.values = copy.deepcopy(values)
  
      bumped_value = False
  
      # Iterate in reverse order so that we can change the value under
      # conditional scope first instead of change the condition value first.
      for hp in reversed(hps.space):
          name = hp.name
          # Bump up the hp value if possible and active.
          if hps.is_active(hp):
              value = hps.values[name]
              if value != all_values[name][-1]:
                  index = all_values[name].index(value) + 1
                  hps.values[name] = all_values[name][index]
                  bumped_value = True
                  break
          # Otherwise, reset to its first value.
          hps.values[name] = default_values[name]
  
      hps.ensure_active_values()
      return hps.values if bumped_value else None
  
file_path: keras-tuner/keras_tuner/tuners/gridsearch.py
imports: import collections
  import copy
  from keras_tuner.api_export import keras_tuner_export
  from keras_tuner.engine import oracle
  from keras_tuner.engine import trial
  from keras_tuner.engine import tuner
label_desc: Use image node_id 4 for calling the GridSearchOracle obj's underlying member method code with example usage: obj._get_next_combination(values) and returns: unknown