class_docstr: One step in the generation strategy, corresponds to a single model.
  Describes the model, how many trials will be generated with this model, what
  minimum number of observations is required to proceed to the next model, etc.
  
  NOTE: Model can be specified either from the model registry
  (`ax.modelbridge.registry.Models` or using a callable model constructor. Only
  models from the registry can be saved, and thus optimization can only be
  resumed if interrupted when using models from the registry.
  
  Args:
      model: A member of `Models` enum or a callable returning an instance of
          `ModelBridge` with an instantiated underlying `Model`. Refer to
          `ax/modelbridge/factory.py` for examples of such callables.
      num_trials: How many trials to generate with the model from this step.
          If set to -1, trials will continue to be generated from this model
          as long as `generation_strategy.gen` is called (available only for
          the last of the generation steps).
      min_trials_observed: How many trials must be completed before the
          generation strategy can proceed to the next step. Defaults to 0.
          If `num_trials` of a given step have been generated but `min_trials_
          observed` have not been completed, a call to `generation_strategy.gen`
          will fail with a `DataRequiredError`.
      max_parallelism: How many trials generated in the course of this step are
          allowed to be run (i.e. have `trial.status` of `RUNNING`) simultaneously.
          If `max_parallelism` trials from this step are already running, a call
          to `generation_strategy.gen` will fail with a `MaxParallelismReached
          Exception`, indicating that more trials need to be completed before
          generating and running next trials.
      use_update: DEPRECATED.
      enforce_num_trials: Whether to enforce that only `num_trials` are generated
          from the given step. If False and `num_trials` have been generated, but
          `min_trials_observed` have not been completed, `generation_strategy.gen`
          will continue generating trials from the current step, exceeding `num_
          trials` for it. Allows to avoid `DataRequiredError`, but delays
          proceeding to next generation step.
      model_kwargs: Dictionary of kwargs to pass into the model constructor on
          instantiation. E.g. if `model` is `Models.SOBOL`, kwargs will be applied
          as `Models.SOBOL(**model_kwargs)`; if `model` is `get_sobol`, `get_sobol(
          **model_kwargs)`. NOTE: if generation strategy is interrupted and
          resumed from a stored snapshot and its last used model has state saved on
          its generator runs, `model_kwargs` is updated with the state dict of the
          model, retrieved from the last generator run of this generation strategy.
      model_gen_kwargs: Each call to `generation_strategy.gen` performs a call to the
          step's model's `gen` under the hood; `model_gen_kwargs` will be passed to
          the model's `gen` like so: `model.gen(**model_gen_kwargs)`.
      completion_criteria: List of TransitionCriterion. All `is_met` must evaluate
          True for the GenerationStrategy to move on to the next Step
      index: Index of this generation step, for use internally in `Generation
          Strategy`. Do not assign as it will be reassigned when instantiating
          `GenerationStrategy` with a list of its steps.
      should_deduplicate: Whether to deduplicate the parameters of proposed arms
          against those of previous arms via rejection sampling. If this is True,
          the generation strategy will discard generator runs produced from the
          generation step that has `should_deduplicate=True` if they contain arms
          already present on the experiment and replace them with new generator runs.
          If no generator run with entirely unique arms could be produced in 5
          attempts, a `GenerationStrategyRepeatedPoints` error will be raised, as we
          assume that the optimization converged when the model can no longer suggest
          unique arms.
  
  Note for developers: by "model" here we really mean an Ax ModelBridge object, which
  contains an Ax Model under the hood. We call it "model" here to simplify and focus
  on explaining the logic of GenerationStep and GenerationStrategy.
class_docstr_tok: ["One","step","in","the","generation","strategy",",","corresponds","to","a","single","model",".","Describes","the","model",",","how","many","trials","will","be","generated","with","this","model",",","what","minimum","number","of","observations","is","required","to","proceed","to","the","next","model",",","etc",".","NOTE",":","Model","can","be","specified","either","from","the","model","registry","(","`","ax.modelbridge.registry.Models","`","or","using","a","callable","model","constructor",".","Only","models","from","the","registry","can","be","saved",",","and","thus","optimization","can","only","be","resumed","if","interrupted","when","using","models","from","the","registry",".","Args",":","model",":","A","member","of","`","Models","`","enum","or","a","callable","returning","an","instance","of","`","ModelBridge","`","with","an","instantiated","underlying","`","Model","`",".","Refer","to","`","ax\/modelbridge\/factory.py","`","for","examples","of","such","callables",".","num_trials",":","How","many","trials","to","generate","with","the","model","from","this","step",".","If","set","to","-1",",","trials","will","continue","to","be","generated","from","this","model","as","long","as","`","generation_strategy.gen","`","is","called","(","available","only","for","the","last","of","the","generation","steps",")",".","min_trials_observed",":","How","many","trials","must","be","completed","before","the","generation","strategy","can","proceed","to","the","next","step",".","Defaults","to","0",".","If","`","num_trials","`","of","a","given","step","have","been","generated","but","`","min_trials_","observed","`","have","not","been","completed",",","a","call","to","`","generation_strategy.gen","`","will","fail","with","a","`","DataRequiredError","`",".","max_parallelism",":","How","many","trials","generated","in","the","course","of","this","step","are","allowed","to","be","run","(","i.e",".","have","`","trial.status","`","of","`","RUNNING","`",")","simultaneously",".","If","`","max_parallelism","`","trials","from","this","step","are","already","running",",","a","call","to","`","generation_strategy.gen","`","will","fail","with","a","`","MaxParallelismReached","Exception","`",",","indicating","that","more","trials","need","to","be","completed","before","generating","and","running","next","trials",".","use_update",":","DEPRECATED",".","enforce_num_trials",":","Whether","to","enforce","that","only","`","num_trials","`","are","generated","from","the","given","step",".","If","False","and","`","num_trials","`","have","been","generated",",","but","`","min_trials_observed","`","have","not","been","completed",",","`","generation_strategy.gen","`","will","continue","generating","trials","from","the","current","step",",","exceeding","`","num_","trials","`","for","it",".","Allows","to","avoid","`","DataRequiredError","`",",","but","delays","proceeding","to","next","generation","step",".","model_kwargs",":","Dictionary","of","kwargs","to","pass","into","the","model","constructor","on","instantiation",".","E.g",".","if","`","model","`","is","`","Models.SOBOL","`",",","kwargs","will","be","applied","as","`","Models.SOBOL","(","*","*","model_kwargs",")","`",";","if","`","model","`","is","`","get_sobol","`",",","`","get_sobol","(","*","*","model_kwargs",")","`",".","NOTE",":","if","generation","strategy","is","interrupted","and","resumed","from","a","stored","snapshot","and","its","last","used","model","has","state","saved","on","its","generator","runs",",","`","model_kwargs","`","is","updated","with","the","state","dict","of","the","model",",","retrieved","from","the","last","generator","run","of","this","generation","strategy",".","model_gen_kwargs",":","Each","call","to","`","generation_strategy.gen","`","performs","a","call","to","the","step","'s","model","'s","`","gen","`","under","the","hood",";","`","model_gen_kwargs","`","will","be","passed","to","the","model","'s","`","gen","`","like","so",":","`","model.gen","(","*","*","model_gen_kwargs",")","`",".","completion_criteria",":","List","of","TransitionCriterion",".","All","`","is_met","`","must","evaluate","True","for","the","GenerationStrategy","to","move","on","to","the","next","Step","index",":","Index","of","this","generation","step",",","for","use","internally","in","`","Generation","Strategy","`",".","Do","not","assign","as","it","will","be","reassigned","when","instantiating","`","GenerationStrategy","`","with","a","list","of","its","steps",".","should_deduplicate",":","Whether","to","deduplicate","the","parameters","of","proposed","arms","against","those","of","previous","arms","via","rejection","sampling",".","If","this","is","True",",","the","generation","strategy","will","discard","generator","runs","produced","from","the","generation","step","that","has","`","should_deduplicate=True","`","if","they","contain","arms","already","present","on","the","experiment","and","replace","them","with","new","generator","runs",".","If","no","generator","run","with","entirely","unique","arms","could","be","produced","in","5","attempts",",","a","`","GenerationStrategyRepeatedPoints","`","error","will","be","raised",",","as","we","assume","that","the","optimization","converged","when","the","model","can","no","longer","suggest","unique","arms",".","Note","for","developers",":","by","``","model","''","here","we","really","mean","an","Ax","ModelBridge","object",",","which","contains","an","Ax","Model","under","the","hood",".","We","call","it","``","model","''","here","to","simplify","and","focus","on","explaining","the","logic","of","GenerationStep","and","GenerationStrategy","."]
docstr: Returns the unique ID of this generation step, which is the index.
code: def _unique_id(self) -> str:
      """Returns the unique ID of this generation step, which is the index."""
      return str(self.index)
  
imports: from __future__ import annotations
  from dataclasses import dataclass, field
  from logging import Logger
  from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Tuple, Union
  from ax import modelbridge
  from ax.core.arm import Arm
  from ax.core.base_trial import TrialStatus
  from ax.core.data import Data
  from ax.core.experiment import Experiment
  from ax.core.generator_run import GeneratorRun
  from ax.core.observation import ObservationFeatures
  from ax.core.optimization_config import OptimizationConfig
  from ax.core.search_space import SearchSpace
  from ax.exceptions.core import UserInputError
  from ax.exceptions.generation_strategy import GenerationStrategyRepeatedPoints
  from ax.modelbridge.base import ModelBridge
  from ax.modelbridge.cross_validation import BestModelSelector, CVDiagnostics, CVResult
  from ax.modelbridge.model_spec import FactoryFunctionModelSpec, ModelSpec
  from ax.modelbridge.registry import ModelRegistryBase
  from ax.modelbridge.transition_criterion import MaxGenerationParallelism, MaxTrials, MinTrials, TransitionCriterion, TrialBasedCriterion
  from ax.utils.common.base import Base, SortableBase
  from ax.utils.common.logger import get_logger
  from ax.utils.common.serialization import SerializationMixin
  from ax.utils.common.typeutils import not_none
label_desc: Use image node_id 3 for calling the GenerationStep obj's underlying member method code with example usage: obj._unique_id() and returns: str