class_docstr: Population based training (PBT) as introduced by Jaderberg et al. 2017.
  
  PBT trains a generation of ``population_size`` seed trials (randomly initialized) for a user
  specified number of iterations e.g. one epoch. The top 80% then move on
  unchanged into the second generation. The bottom 20% are re-sampled from
  the top 20% and perturbed. The second generation again trains for the same
  number of iterations and the same procedure is repeated to move into the
  third generation etc.
  
  Args:
      num_generations (int): the number of generations to run for.
      population_size (int): the number of randomly intialized trials at the
          beginning and number of concurrent trials after that.
      parameter_range (dict[Union[list,tuple]): upper and lower bounds beyond
          which parameters cannot be perturbed.
      perturbation_factors (tuple[float]): the factors by which continuous
          parameters are multiplied upon perturbation; one is sampled randomly
          at a time.
class_docstr_tok: ["Population","based","training","(","PBT",")","as","introduced","by","Jaderberg","et","al",".","2017",".","PBT","trains","a","generation","of","``","population_size","``","seed","trials","(","randomly","initialized",")","for","a","user","specified","number","of","iterations","e.g",".","one","epoch",".","The","top","80","%","then","move","on","unchanged","into","the","second","generation",".","The","bottom","20","%","are","re-sampled","from","the","top","20","%","and","perturbed",".","The","second","generation","again","trains","for","the","same","number","of","iterations","and","the","same","procedure","is","repeated","to","move","into","the","third","generation","etc",".","Args",":","num_generations","(","int",")",":","the","number","of","generations","to","run","for",".","population_size","(","int",")",":","the","number","of","randomly","intialized","trials","at","the","beginning","and","number","of","concurrent","trials","after","that",".","parameter_range","(","dict","[","Union","[","list",",","tuple","]",")",":","upper","and","lower","bounds","beyond","which","parameters","can","not","be","perturbed",".","perturbation_factors","(","tuple","[","float","]",")",":","the","factors","by","which","continuous","parameters","are","multiplied","upon","perturbation",";","one","is","sampled","randomly","at","a","time","."]
code: def get_suggestion(self, parameters, results, lower_is_better):
      self.count += 1
      self.generation = (self.count - 1) // self.population_size + 1
  
      if self.generation == 1:
          trial = self.random_sampler.get_suggestion(
              parameters, results, lower_is_better
          )
          trial["lineage"] = ""
          trial["load_from"] = ""
          trial["save_to"] = str(self.count)
      elif self.generation > self.num_generations:
          return AlgorithmState.DONE
      else:
          trial = self._truncation_selection(
              parameters=parameters,
              results=results,
              lower_is_better=lower_is_better,
          )
          trial["load_from"] = str(int(trial["save_to"]))
          trial["save_to"] = str(int(self.count))
          trial["lineage"] += trial["load_from"] + ","
      trial["generation"] = self.generation
      return trial
  
imports: import os
  import random
  import numpy
  import logging
  import sherpa
  import pandas
  import sklearn.gaussian_process
  from sherpa.core import Choice, Continuous, Discrete, Ordinal, AlgorithmState
  from sherpa.core import rng
  import sklearn.model_selection
  import collections
label_desc: Use image node_id 2 for calling the PopulationBasedTraining obj's underlying member method code with example usage: obj.get_suggestion(parameters, results, lower_is_better) and returns: trial, AlgorithmState