docstr: BO-HB uses (just like Hyperband) SuccessiveHalving for each iteration.
  See Li et al. (2016) for reference.
  
  Parameters:
  -----------
          iteration: int
                  the index of the iteration to be instantiated
  
  Returns:
  --------
          SuccessiveHalving: the SuccessiveHalving iteration with the
                  corresponding number of configurations
docstr_tok: ["BO-HB","uses","(","just","like","Hyperband",")","SuccessiveHalving","for","each","iteration",".","See","Li","et","al",".","(","2016",")","for","reference",".","Parameters",":","--","--","--","--","--","-","iteration",":","int","the","index","of","the","iteration","to","be","instantiated","Returns",":","--","--","--","--","SuccessiveHalving",":","the","SuccessiveHalving","iteration","with","the","corresponding","number","of","configurations"]
code: def get_next_iteration(self, iteration, iteration_kwargs={}):
      """
      BO-HB uses (just like Hyperband) SuccessiveHalving for each iteration.
      See Li et al. (2016) for reference.
  
      Parameters:
      -----------
              iteration: int
                      the index of the iteration to be instantiated
  
      Returns:
      --------
              SuccessiveHalving: the SuccessiveHalving iteration with the
                      corresponding number of configurations
      """
  
      min_budget = max(
          self.min_budget,
          self.config_generator.largest_budget_with_model(),
      )
      max_budget = self.max_budget
      eta = self.eta
  
      # precompute some HB stuff
      max_SH_iter = (
          -int(np.log(min_budget / max_budget) / np.log(eta)) + 1
      )
      budgets = max_budget * np.power(
          eta, -np.linspace(max_SH_iter - 1, 0, max_SH_iter)
      )
  
      # number of 'SH rungs'
      s = max_SH_iter - 1
      # number of configurations in that bracket
      n0 = int(np.floor((self.max_SH_iter) / (s + 1)) * eta**s)
      ns = np.array(
          [max(int(n0 * (eta ** (-i))), 1) for i in range(s + 1)]
      )
  
      while (ns * budgets[-s - 1 :]).sum() <= self.budget_per_iteration:
          n0 += 1
          ns = np.array(
              [max(int(n0 * (eta ** (-i))), 1) for i in range(s + 1)]
          )
  
      n0 -= 1
      ns = np.array(
          [max(int(n0 * (eta ** (-i))), 1) for i in range(s + 1)]
      )
  
      assert (
          ns * budgets[-s - 1 :]
      ).sum() <= self.budget_per_iteration, (
          "Sampled iteration exceeds the budget per iteration!"
      )
  
      return SuccessiveHalving(
          HPB_iter=iteration,
          num_configs=ns,
          budgets=budgets,
          config_sampler=self.config_generator.get_config,
          **iteration_kwargs,
      )
  
file_path: auptimizer/src/aup/Proposer/hpbandster/optimizers/h2bo.py
imports: import os
  import time
  import math
  import copy
  import logging
  import numpy
  import ConfigSpace
  from hpbandster.core.master import Master
  from hpbandster.optimizers.iterations import SuccessiveHalving
  from hpbandster.optimizers.config_generators.h2bo import H2BO
label_desc: Use image node_id 2 for calling the H2BO obj's underlying member method code with example usage: obj.get_next_iteration(iteration, iteration_kwargs) and returns: SuccessiveHalving