class_docstr: Naive Evolution comes from `Large-Scale Evolution of Image Classifiers <https://arxiv.org/pdf/1703.01041.pdf>`__
  It randomly initializes a population based on the search space.
  For each generation, it chooses better ones and does some mutation.
  (e.g., changes a hyperparameter, adds/removes one layer, etc.) on them to get the next generation.
  Naive Evolution requires many trials to works but it’s very simple and it’s easily expanded with new features.
  
  Examples
  --------
  
  .. code-block::
  
      config.tuner.name = 'Evolution'
      config.tuner.class_args = {
              'optimize_mode': 'maximize',
              'population_size': 100
      }
  
  Parameters
  ----------
  optimize_mode: str
      Optimize mode, 'maximize' or 'minimize'.
      If 'maximize', the tuner will try to maximize metrics. If 'minimize', the tuner will try to minimize metrics.
  population_size: int
      The initial size of the population (trial num) in the evolution tuner(default=32).
      The larger population size, the better evolution performance.
      It's suggested that ``population_size`` be much larger than ``concurrency`` so users can get the most out of the algorithm.
      And at least ``concurrency``, or the tuner will fail on its first generation of parameters.
class_docstr_tok: ["Naive","Evolution","comes","from","`","Large-Scale","Evolution","of","Image","Classifiers","<","https",":","\/\/arxiv.org\/pdf\/1703.01041.pdf",">","`","__","It","randomly","initializes","a","population","based","on","the","search","space",".","For","each","generation",",","it","chooses","better","ones","and","does","some","mutation",".","(","e.g.",",","changes","a","hyperparameter",",","adds\/removes","one","layer",",","etc",".",")","on","them","to","get","the","next","generation",".","Naive","Evolution","requires","many","trials","to","works","but","it","\u2019","s","very","simple","and","it","\u2019","s","easily","expanded","with","new","features",".","Examples","--","--","--","--","..","code-block",":",":","config.tuner.name","=","'Evolution'","config.tuner.class_args","=","{","'optimize_mode","'",":","'maximize","'",",","'population_size","'",":","100","}","Parameters","--","--","--","--","--","optimize_mode",":","str","Optimize","mode",",","'maximize","'","or","'minimize","'",".","If","'maximize","'",",","the","tuner","will","try","to","maximize","metrics",".","If","'minimize","'",",","the","tuner","will","try","to","minimize","metrics",".","population_size",":","int","The","initial","size","of","the","population","(","trial","num",")","in","the","evolution","tuner","(","default=32",")",".","The","larger","population","size",",","the","better","evolution","performance",".","It","'s","suggested","that","``","population_size","``","be","much","larger","than","``","concurrency","``","so","users","can","get","the","most","out","of","the","algorithm",".","And","at","least","``","concurrency","``",",","or","the","tuner","will","fail","on","its","first","generation","of","parameters","."]
docstr: This function will returns a dict of trial (hyper-)parameters.
  If no trial configration for now, self.credit plus 1 to send the config later
  
  Parameters
  ----------
  
  parameter_id : int
  
  Returns
  -------
  
  dict
      One newly generated configuration.
docstr_tok: ["This","function","will","returns","a","dict","of","trial","(","hyper-",")","parameters",".","If","no","trial","configration","for","now",",","self.credit","plus","1","to","send","the","config","later","Parameters","--","--","--","--","--","parameter_id",":","int","Returns","--","--","--","-","dict","One","newly","generated","configuration","."]
code: def generate_parameters(self, parameter_id, **kwargs):
      """
      This function will returns a dict of trial (hyper-)parameters.
      If no trial configration for now, self.credit plus 1 to send the config later
  
      Parameters
      ----------
  
      parameter_id : int
  
      Returns
      -------
  
      dict
          One newly generated configuration.
      """
      if not self.population:
          raise RuntimeError("The population is empty")
  
      if self.num_running_trials >= self.population_size:
          logger.warning(
              "No enough trial config, population_size is suggested to be larger than trialConcurrency"
          )
          self.credit += 1
          self.param_ids.append(parameter_id)
          raise nni.NoMoreTrialError("no more parameters now.")
  
      return self._generate_individual(parameter_id)
  
imports: from __future__ import annotations
  import copy
  import random
  import logging
  from collections import deque
  import numpy
  from schema import Schema, Optional
  import nni
  from nni import ClassArgsValidator
  from nni.tuner import Tuner
  from nni.utils import OptimizeMode, extract_scalar_reward, split_index, json2parameter, json2space
label_desc: Use image node_id 7 for calling the EvolutionTuner obj's underlying member method code with example usage: obj.generate_parameters(parameter_id) and returns: self