Current git-hash: e82f9eaa2bf28981bfedf32ca86bf6fb67634126 (last fully tested stable version 4 commits ago [ac6b16e91a732d78f06205417c10392572a05f84, 8987])
⠋Importing logging...⠋Importing warnings...⠋Importing argparse...⠋Importing datetime...⠋Importing dataclass...⠋Importing socket...⠋Importing stat...⠋Importing pwd...⠋Importing base64...⠋Importing json...⠋Importing yaml...⠋Importing toml...⠋Importing csv...⠋Importing ast...⠋Importing rich.table...⠋Importing rich print...⠋Importing rich.pretty...⠋Importing pformat...⠋Importing rich.prompt...⠋Importing types.FunctionType...⠋Importing typing...⠋Importing ThreadPoolExecutor...⠋Importing submitit.LocalExecutor...⠋Importing submitit.Job...⠋Importing importlib.util...⠋Importing platform...⠋Importing inspect frame info...⠋Importing pathlib.Path...⠋Importing uuid...⠋Importing cowsay...⠋Importing shutil...⠋Importing itertools.combinations...⠋Importing os.listdir...⠋Importing os.path...⠋Importing PIL.Image...⠋Importing sixel...⠋Importing subprocess...⠋Importing tqdm...⠋Importing beartype...⠋Importing statistics...⠋Trying to import pyfiglet...⠙Importing helpers...⠋Importing pareto...⠋Parsing arguments...⠸Importing torch...⠋Importing numpy...
[WARNING 11-01 12:38:21] ax.service.utils.with_db_settings_base: Ax currently requires a sqlalchemy version below 2.0. This will be addressed in a future release. Disabling SQL storage in Ax for now, if you would like to use SQL storage please install Ax with mysql extras via `pip install ax-platform[mysql]`.
⠧Importing ax...⠋Importing ax.core.generator_run...⠋Importing Cont_X_trans and Y_trans from ax.adapter.registry...⠋Importing ax.core.arm...⠋Importing ax.core.objective...⠋Importing ax.core.Metric...⠋Importing ax.exceptions.core...⠋Importing ax.exceptions.generation_strategy...⠋Importing CORE_DECODER_REGISTRY...⠋Trying ax.generation_strategy.generation_node...⠋Importing GenerationStep, GenerationStrategy from generation_strategy...⠋Importing GenerationNode from generation_node...⠋Importing ExternalGenerationNode...⠋Importing MaxTrials...⠋Importing GeneratorSpec...⠋Importing Models from ax.generation_strategy.registry...⠋Importing get_pending_observation_features...⠋Importing load_experiment...⠋Importing save_experiment...⠋Importing save_experiment_to_db...⠋Importing TrialStatus...⠋Importing Data...⠋Importing Experiment...⠋Importing parameter types...⠋Importing TParameterization...⠋Importing pandas...⠋Importing AxClient and ObjectiveProperties...⠋Importing RandomForestRegressor...⠋Importing botorch...⠋Importing submitit...⠋Importing ax logger...⠋Importing SQL-Storage-Stuff...
Run-UUID: 7c251721-11fa-4e98-9068-3bafd8941375
_________________________________________________
/ \
| OmniOpt2 - Hyperparameter quest: It's dangerous t |
| o go alone, take this! |
\ /
=================================================
\
\
\
\
__---__
_- /--______
__--( / \ )XXXXXXXXXXX\v.
.-XXX( O O )XXXXXXXXXXXXXXX-
/XXX( U ) XXXXXXX\
/XXXXX( )--_ XXXXXXXXXXX\
/XXXXX/ ( O ) XXXXXX \XXXXX\
XXXXX/ / XXXXXX \__ \XXXXX
XXXXXX__/ XXXXXX \__---->
---___ XXX__/ XXXXXX \__ /
\- --__/ ___/\ XXXXXX / ___--/=
\-\ ___/ XXXXXX '--- XXXXXX
\-\/XXX\ XXXXXX /XXXXX
\XXXXXXXXX \ /XXXXX/
\XXXXXX > _/XXXXX/
\XXXXX--__/ __-- XXXX/
-XXXXXXXX--------------- XXXXXX-
\XXXXXXXXXXXXXXXXXXXXXXXXXX/
""VXXXXXXXXXXXXXXXXXXV""
⠋Writing worker creation log...
./omniopt --live_share --send_anonymized_usage_stats --partition alpha --experiment_name=__main__tests__BOTORCH_MODULAR___nogridsearch --mem_gb=1 --time=60 --worker_timeout=5 --max_eval 2 --num_parallel_jobs 2 --gpus=0 --run_program Li8udGVzdHMvb3B0aW1pemF0aW9uX2V4YW1wbGUgIC0taW50X3BhcmFtPSclKGludF9wYXJhbSknIC0tZmxvYXRfcGFyYW09JyUoZmxvYXRfcGFyYW0pJyAtLWNob2ljZV9wYXJhbT0nJShjaG9pY2VfcGFyYW0pJyAtLWludF9wYXJhbV90d289JyUoaW50X3BhcmFtX3R3byknIC0tbnJfcmVzdWx0cz0x --parameter int_param range -100 10 int --parameter float_param range -100 10 float --parameter choice_param choice 1,2,4,8,16,hallo --parameter int_param_two range -100 10 int --num_random_steps 1 --model BOTORCH_MODULAR --auto_exclude_defective_hosts --generate_all_jobs_at_once --follow --show_generate_time_table
⠋Disabling logging...⠋Setting run folder...⠋Creating folder /home/norman/repos/OmniOpt/runs/__main__tests__BOTORCH_MODULAR___nogridsearch/11...⠋Writing revert_to_random_when_seemingly_exhausted file ...⠋Writing username state file...⠋Writing result names file...⠋Writing result min/max file...⠋Saving state files...Run-folder: /home/norman/repos/OmniOpt/runs/__main__tests__BOTORCH_MODULAR___nogridsearch/11⠋Writing live_share file if it is present...⠋Writing job_start_time file...⠋Writing git information⠋Checking max_eval...⠋Calculating number of steps...⠋Adding excluded nodes...⠋Initializing ax_client...⠋Setting orchestrator...See https://imageseg.scads.de/omniax/share?user_id=norman&experiment_name=__main__tests__BOTORCH_MODULAR___nogridsearch&run_nr=11 for live-results.You have 4 CPUs available for the main process.No CUDA devices found.Generation strategy: SOBOL for 1 step and then BOTORCH_MODULAR for 1 step.
Run-Program: ./.tests/optimization_example --int_param='%(int_param)' --float_param='%(float_param)' --choice_param='%(choice_param)' --int_param_two='%(int_param_two)' --nr_results=1
Experiment parameters
┏━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━┓
┃Name ┃Type ┃Lower bound┃Upper bound┃Values ┃Type ┃Log Scale?┃
┡━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━┩
│int_param │range │-100 │10 ││int │No │
│float_param │range │-100 │10 ││float│No │
│choice_param │choice│││1, 2, 4, 8, 16, hallo│││
│int_param_two│range │-100 │10 ││int │No │
└───────────────┴────────┴─────────────┴─────────────┴───────────────────────┴───────┴────────────┘
Result-Names
┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃Result-Name┃Min or max?┃
┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
│RESULT │ min│
└─────────────┴─────────────┘
⠋Write files and show overview
0%|░░░░░░░░░░| 0/2 [00:00, ?it/s]Help on GenerationStrategy in module ax.generation_strategy.generation_strategy object:
class GenerationStrategy(ax.utils.common.base.Base)
| GenerationStrategy(steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
|
| GenerationStrategy describes which node should be used to generate new
| points for which trials, enabling and automating use of different nodes
| throughout the optimization process. For instance, it allows to use one
| node for the initialization trials, and another one for all subsequent
| trials. In the general case, this allows to automate use of an arbitrary
| number of nodes to generate an arbitrary numbers of trials.
|
| Args:
| nodes: A list of `GenerationNode`. Each `GenerationNode` in the list
| represents a single node in a `GenerationStrategy` which, when
| composed of `GenerationNodes`, can be conceptualized as a graph instead
| of a linear list. `TransitionCriterion` defined in each `GenerationNode`
| represent the edges in the `GenerationStrategy` graph. `GenerationNodes`
| are more flexible than `GenerationSteps` and new `GenerationStrategies`
| should use nodes. Notably, either, but not both, of `nodes` and `steps`
| must be provided.
| steps: A list of `GenerationStep` describing steps of this strategy.
| name: An optional name for this generation strategy. If not specified,
| strategy's name will be names of its nodes' generators joined with '+'.
|
| Method resolution order:
| GenerationStrategy
| ax.utils.common.base.Base
| builtins.object
|
| Methods defined here:
|
| __init__(self, steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self) -> 'str'
| String representation of this generation strategy.
|
| clone_reset(self) -> 'GenerationStrategy'
| Copy this generation strategy without it's state.
|
| current_generator_run_limit(self) -> 'tuple[int, bool]'
| First check if we can move the generation strategy to the next node, which
| is safe, as the next call to ``gen`` will just pick up from there. Then
| determine how many generator runs this generation strategy can generate right
| now, assuming each one of them becomes its own trial, and whether optimization
| is completed.
|
| Returns: a two-item tuple of:
| - the number of generator runs that can currently be produced, with -1
| meaning unlimited generator runs,
| - whether optimization is completed and the generation strategy cannot
| generate any more generator runs at all.
|
| gen(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int | None' = None, fixed_features: 'ObservationFeatures | None' = None, num_trials: 'int' = 1, arms_per_node: 'dict[str, int] | None' = None) -> 'list[list[GeneratorRun]]'
| Produce GeneratorRuns for multiple trials at once with the possibility of
| using multiple models per trial, getting multiple GeneratorRuns per trial.
|
| Args:
| experiment: ``Experiment``, for which the generation strategy is producing
| a new generator run in the course of ``gen``, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's ``gen``, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the ``experiment``.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
| n: Integer representing how many total arms should be in the generator
| runs produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output generator runs with number of
| arms that can differ from `n`.
| fixed_features: An optional set of ``ObservationFeatures`` that will be
| passed down to the underlying nodes. Note: if provided this will
| override any algorithmically determined fixed features so it is
| important to specify all necessary fixed features.
| num_trials: Number of trials to generate generator runs for in this call.
| If not provided, defaults to 1.
| arms_per_node: An optional map from node name to the number of arms to
| generate from that node. If not provided, will default to the number
| of arms specified in the node's ``InputConstructors`` or n if no
| ``InputConstructors`` are defined on the node. We expect either n or
| arms_per_node to be provided, but not both, and this is an advanced
| argument that should only be used by advanced users.
|
| Returns:
| A list of lists of lists generator runs. Each outer list represents
| a trial being suggested and each inner list represents a generator
| run for that trial.
|
| gen_single_trial(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int' = 1, fixed_features: 'ObservationFeatures | None' = None) -> 'GeneratorRun'
| Produce the next points in the experiment. Additional kwargs passed to
| this method are propagated directly to the underlying node's `gen`, along
| with the `model_gen_kwargs` set on the current generation node.
|
| NOTE: Each generator run returned from this function must become a single
| trial on the experiment to comply with assumptions made in generation
| strategy. Do not split one generator run produced from generation strategy
| into multiple trials (never making a generator run into a trial is allowed).
|
| Args:
| experiment: Experiment, for which the generation strategy is producing
| a new generator run in the course of `gen`, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's `gen`, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the `experiment`.
| n: Integer representing how many arms should be in the generator run
| produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output a generator run with number of
| arms that can differ from `n`.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| adapter
| The adapter from the current node of this strategy. Returns None
| if no adapter has been set yet. This can happen if no generator runs have
| been produced from this GS or if the current node does not utilize
| adapters (the case for ``ExternalGenerationNode``).
|
| current_node
| Current generation node.
|
| current_node_name
| Current generation node name.
|
| current_step
| Current generation step.
|
| current_step_index
| Returns the index of the current generation step. This attribute
| is replaced by node_name in newer GenerationStrategies but surfaced here
| for backward compatibility.
|
| is_node_based
| Whether this strategy consists of GenerationNodes only.
| This is useful for determining initialization properties and
| other logic.
|
| last_generator_run
| Latest generator run produced by this generation strategy.
| Returns None if no generator runs have been produced yet.
|
| name
| Name of this generation strategy.
|
| nodes_dict
| Returns a dictionary mapping node names to nodes.
|
| optimization_complete
| Checks whether all nodes are completed in the generation strategy.
|
| trials_as_df
| Puts information on individual trials into a data frame for easy
| viewing.
|
| THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
| Please use `Experiment.to_df()` instead.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| experiment
| Experiment, currently set on this generation strategy.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| DEFAULT_N = 1
|
| __annotations__ = {'DEFAULT_N': 'int', '_curr': 'GenerationNode', '_ex...
|
| ----------------------------------------------------------------------
| Methods inherited from ax.utils.common.base.Base:
|
| __eq__ = _type_safe_equals(self, other)
| # no type annotation for now; breaks sphinx-autodoc-typehints
| # pyre-fixme[3]: Return type must be annotated.
| # pyre-fixme[2]: Parameter must be annotated.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ax.utils.common.base.Base:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| db_id
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ax.utils.common.base.Base:
|
| __hash__ = None
!!!!! gs: GenerationStrategy(name='SOBOL for 1 step+BOTORCH_MODULAR for 1 step', nodes=[GenerationNode(node_name='SOBOL', generator_specs=[GeneratorSpec(generator_enum=Sobol, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')]), GenerationNode(node_name='BOTORCH_MODULAR', generator_specs=[GeneratorSpec(generator_enum=BoTorch, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')])]) !!!!
SOBOL, Started OmniOpt2 run...: 0%|░░░░░░░░░░| 0/2 [00:00, ?it/s]Help on GenerationStrategy in module ax.generation_strategy.generation_strategy object:
class GenerationStrategy(ax.utils.common.base.Base)
| GenerationStrategy(steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
|
| GenerationStrategy describes which node should be used to generate new
| points for which trials, enabling and automating use of different nodes
| throughout the optimization process. For instance, it allows to use one
| node for the initialization trials, and another one for all subsequent
| trials. In the general case, this allows to automate use of an arbitrary
| number of nodes to generate an arbitrary numbers of trials.
|
| Args:
| nodes: A list of `GenerationNode`. Each `GenerationNode` in the list
| represents a single node in a `GenerationStrategy` which, when
| composed of `GenerationNodes`, can be conceptualized as a graph instead
| of a linear list. `TransitionCriterion` defined in each `GenerationNode`
| represent the edges in the `GenerationStrategy` graph. `GenerationNodes`
| are more flexible than `GenerationSteps` and new `GenerationStrategies`
| should use nodes. Notably, either, but not both, of `nodes` and `steps`
| must be provided.
| steps: A list of `GenerationStep` describing steps of this strategy.
| name: An optional name for this generation strategy. If not specified,
| strategy's name will be names of its nodes' generators joined with '+'.
|
| Method resolution order:
| GenerationStrategy
| ax.utils.common.base.Base
| builtins.object
|
| Methods defined here:
|
| __init__(self, steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self) -> 'str'
| String representation of this generation strategy.
|
| clone_reset(self) -> 'GenerationStrategy'
| Copy this generation strategy without it's state.
|
| current_generator_run_limit(self) -> 'tuple[int, bool]'
| First check if we can move the generation strategy to the next node, which
| is safe, as the next call to ``gen`` will just pick up from there. Then
| determine how many generator runs this generation strategy can generate right
| now, assuming each one of them becomes its own trial, and whether optimization
| is completed.
|
| Returns: a two-item tuple of:
| - the number of generator runs that can currently be produced, with -1
| meaning unlimited generator runs,
| - whether optimization is completed and the generation strategy cannot
| generate any more generator runs at all.
|
| gen(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int | None' = None, fixed_features: 'ObservationFeatures | None' = None, num_trials: 'int' = 1, arms_per_node: 'dict[str, int] | None' = None) -> 'list[list[GeneratorRun]]'
| Produce GeneratorRuns for multiple trials at once with the possibility of
| using multiple models per trial, getting multiple GeneratorRuns per trial.
|
| Args:
| experiment: ``Experiment``, for which the generation strategy is producing
| a new generator run in the course of ``gen``, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's ``gen``, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the ``experiment``.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
| n: Integer representing how many total arms should be in the generator
| runs produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output generator runs with number of
| arms that can differ from `n`.
| fixed_features: An optional set of ``ObservationFeatures`` that will be
| passed down to the underlying nodes. Note: if provided this will
| override any algorithmically determined fixed features so it is
| important to specify all necessary fixed features.
| num_trials: Number of trials to generate generator runs for in this call.
| If not provided, defaults to 1.
| arms_per_node: An optional map from node name to the number of arms to
| generate from that node. If not provided, will default to the number
| of arms specified in the node's ``InputConstructors`` or n if no
| ``InputConstructors`` are defined on the node. We expect either n or
| arms_per_node to be provided, but not both, and this is an advanced
| argument that should only be used by advanced users.
|
| Returns:
| A list of lists of lists generator runs. Each outer list represents
| a trial being suggested and each inner list represents a generator
| run for that trial.
|
| gen_single_trial(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int' = 1, fixed_features: 'ObservationFeatures | None' = None) -> 'GeneratorRun'
| Produce the next points in the experiment. Additional kwargs passed to
| this method are propagated directly to the underlying node's `gen`, along
| with the `model_gen_kwargs` set on the current generation node.
|
| NOTE: Each generator run returned from this function must become a single
| trial on the experiment to comply with assumptions made in generation
| strategy. Do not split one generator run produced from generation strategy
| into multiple trials (never making a generator run into a trial is allowed).
|
| Args:
| experiment: Experiment, for which the generation strategy is producing
| a new generator run in the course of `gen`, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's `gen`, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the `experiment`.
| n: Integer representing how many arms should be in the generator run
| produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output a generator run with number of
| arms that can differ from `n`.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| adapter
| The adapter from the current node of this strategy. Returns None
| if no adapter has been set yet. This can happen if no generator runs have
| been produced from this GS or if the current node does not utilize
| adapters (the case for ``ExternalGenerationNode``).
|
| current_node
| Current generation node.
|
| current_node_name
| Current generation node name.
|
| current_step
| Current generation step.
|
| current_step_index
| Returns the index of the current generation step. This attribute
| is replaced by node_name in newer GenerationStrategies but surfaced here
| for backward compatibility.
|
| is_node_based
| Whether this strategy consists of GenerationNodes only.
| This is useful for determining initialization properties and
| other logic.
|
| last_generator_run
| Latest generator run produced by this generation strategy.
| Returns None if no generator runs have been produced yet.
|
| name
| Name of this generation strategy.
|
| nodes_dict
| Returns a dictionary mapping node names to nodes.
|
| optimization_complete
| Checks whether all nodes are completed in the generation strategy.
|
| trials_as_df
| Puts information on individual trials into a data frame for easy
| viewing.
|
| THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
| Please use `Experiment.to_df()` instead.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| experiment
| Experiment, currently set on this generation strategy.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| DEFAULT_N = 1
|
| __annotations__ = {'DEFAULT_N': 'int', '_curr': 'GenerationNode', '_ex...
|
| ----------------------------------------------------------------------
| Methods inherited from ax.utils.common.base.Base:
|
| __eq__ = _type_safe_equals(self, other)
| # no type annotation for now; breaks sphinx-autodoc-typehints
| # pyre-fixme[3]: Return type must be annotated.
| # pyre-fixme[2]: Parameter must be annotated.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ax.utils.common.base.Base:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| db_id
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ax.utils.common.base.Base:
|
| __hash__ = None
!!!!! gs: GenerationStrategy(name='SOBOL for 1 step+BOTORCH_MODULAR for 1 step', nodes=[GenerationNode(node_name='SOBOL', generator_specs=[GeneratorSpec(generator_enum=Sobol, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')]), GenerationNode(node_name='BOTORCH_MODULAR', generator_specs=[GeneratorSpec(generator_enum=BoTorch, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')])]) !!!!
Help on GenerationStrategy in module ax.generation_strategy.generation_strategy object:
class GenerationStrategy(ax.utils.common.base.Base)
| GenerationStrategy(steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
|
| GenerationStrategy describes which node should be used to generate new
| points for which trials, enabling and automating use of different nodes
| throughout the optimization process. For instance, it allows to use one
| node for the initialization trials, and another one for all subsequent
| trials. In the general case, this allows to automate use of an arbitrary
| number of nodes to generate an arbitrary numbers of trials.
|
| Args:
| nodes: A list of `GenerationNode`. Each `GenerationNode` in the list
| represents a single node in a `GenerationStrategy` which, when
| composed of `GenerationNodes`, can be conceptualized as a graph instead
| of a linear list. `TransitionCriterion` defined in each `GenerationNode`
| represent the edges in the `GenerationStrategy` graph. `GenerationNodes`
| are more flexible than `GenerationSteps` and new `GenerationStrategies`
| should use nodes. Notably, either, but not both, of `nodes` and `steps`
| must be provided.
| steps: A list of `GenerationStep` describing steps of this strategy.
| name: An optional name for this generation strategy. If not specified,
| strategy's name will be names of its nodes' generators joined with '+'.
|
| Method resolution order:
| GenerationStrategy
| ax.utils.common.base.Base
| builtins.object
|
| Methods defined here:
|
| __init__(self, steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self) -> 'str'
| String representation of this generation strategy.
|
| clone_reset(self) -> 'GenerationStrategy'
| Copy this generation strategy without it's state.
|
| current_generator_run_limit(self) -> 'tuple[int, bool]'
| First check if we can move the generation strategy to the next node, which
| is safe, as the next call to ``gen`` will just pick up from there. Then
| determine how many generator runs this generation strategy can generate right
| now, assuming each one of them becomes its own trial, and whether optimization
| is completed.
|
| Returns: a two-item tuple of:
| - the number of generator runs that can currently be produced, with -1
| meaning unlimited generator runs,
| - whether optimization is completed and the generation strategy cannot
| generate any more generator runs at all.
|
| gen(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int | None' = None, fixed_features: 'ObservationFeatures | None' = None, num_trials: 'int' = 1, arms_per_node: 'dict[str, int] | None' = None) -> 'list[list[GeneratorRun]]'
| Produce GeneratorRuns for multiple trials at once with the possibility of
| using multiple models per trial, getting multiple GeneratorRuns per trial.
|
| Args:
| experiment: ``Experiment``, for which the generation strategy is producing
| a new generator run in the course of ``gen``, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's ``gen``, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the ``experiment``.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
| n: Integer representing how many total arms should be in the generator
| runs produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output generator runs with number of
| arms that can differ from `n`.
| fixed_features: An optional set of ``ObservationFeatures`` that will be
| passed down to the underlying nodes. Note: if provided this will
| override any algorithmically determined fixed features so it is
| important to specify all necessary fixed features.
| num_trials: Number of trials to generate generator runs for in this call.
| If not provided, defaults to 1.
| arms_per_node: An optional map from node name to the number of arms to
| generate from that node. If not provided, will default to the number
| of arms specified in the node's ``InputConstructors`` or n if no
| ``InputConstructors`` are defined on the node. We expect either n or
| arms_per_node to be provided, but not both, and this is an advanced
| argument that should only be used by advanced users.
|
| Returns:
| A list of lists of lists generator runs. Each outer list represents
| a trial being suggested and each inner list represents a generator
| run for that trial.
|
| gen_single_trial(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int' = 1, fixed_features: 'ObservationFeatures | None' = None) -> 'GeneratorRun'
| Produce the next points in the experiment. Additional kwargs passed to
| this method are propagated directly to the underlying node's `gen`, along
| with the `model_gen_kwargs` set on the current generation node.
|
| NOTE: Each generator run returned from this function must become a single
| trial on the experiment to comply with assumptions made in generation
| strategy. Do not split one generator run produced from generation strategy
| into multiple trials (never making a generator run into a trial is allowed).
|
| Args:
| experiment: Experiment, for which the generation strategy is producing
| a new generator run in the course of `gen`, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's `gen`, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the `experiment`.
| n: Integer representing how many arms should be in the generator run
| produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output a generator run with number of
| arms that can differ from `n`.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| adapter
| The adapter from the current node of this strategy. Returns None
| if no adapter has been set yet. This can happen if no generator runs have
| been produced from this GS or if the current node does not utilize
| adapters (the case for ``ExternalGenerationNode``).
|
| current_node
| Current generation node.
|
| current_node_name
| Current generation node name.
|
| current_step
| Current generation step.
|
| current_step_index
| Returns the index of the current generation step. This attribute
| is replaced by node_name in newer GenerationStrategies but surfaced here
| for backward compatibility.
|
| is_node_based
| Whether this strategy consists of GenerationNodes only.
| This is useful for determining initialization properties and
| other logic.
|
| last_generator_run
| Latest generator run produced by this generation strategy.
| Returns None if no generator runs have been produced yet.
|
| name
| Name of this generation strategy.
|
| nodes_dict
| Returns a dictionary mapping node names to nodes.
|
| optimization_complete
| Checks whether all nodes are completed in the generation strategy.
|
| trials_as_df
| Puts information on individual trials into a data frame for easy
| viewing.
|
| THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
| Please use `Experiment.to_df()` instead.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| experiment
| Experiment, currently set on this generation strategy.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| DEFAULT_N = 1
|
| __annotations__ = {'DEFAULT_N': 'int', '_curr': 'GenerationNode', '_ex...
|
| ----------------------------------------------------------------------
| Methods inherited from ax.utils.common.base.Base:
|
| __eq__ = _type_safe_equals(self, other)
| # no type annotation for now; breaks sphinx-autodoc-typehints
| # pyre-fixme[3]: Return type must be annotated.
| # pyre-fixme[2]: Parameter must be annotated.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ax.utils.common.base.Base:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| db_id
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ax.utils.common.base.Base:
|
| __hash__ = None
!!!!! gs: GenerationStrategy(name='SOBOL for 1 step+BOTORCH_MODULAR for 1 step', nodes=[GenerationNode(node_name='SOBOL', generator_specs=[GeneratorSpec(generator_enum=Sobol, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')]), GenerationNode(node_name='BOTORCH_MODULAR', generator_specs=[GeneratorSpec(generator_enum=BoTorch, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')])]) !!!!
Help on GenerationStrategy in module ax.generation_strategy.generation_strategy object:
class GenerationStrategy(ax.utils.common.base.Base)
| GenerationStrategy(steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
|
| GenerationStrategy describes which node should be used to generate new
| points for which trials, enabling and automating use of different nodes
| throughout the optimization process. For instance, it allows to use one
| node for the initialization trials, and another one for all subsequent
| trials. In the general case, this allows to automate use of an arbitrary
| number of nodes to generate an arbitrary numbers of trials.
|
| Args:
| nodes: A list of `GenerationNode`. Each `GenerationNode` in the list
| represents a single node in a `GenerationStrategy` which, when
| composed of `GenerationNodes`, can be conceptualized as a graph instead
| of a linear list. `TransitionCriterion` defined in each `GenerationNode`
| represent the edges in the `GenerationStrategy` graph. `GenerationNodes`
| are more flexible than `GenerationSteps` and new `GenerationStrategies`
| should use nodes. Notably, either, but not both, of `nodes` and `steps`
| must be provided.
| steps: A list of `GenerationStep` describing steps of this strategy.
| name: An optional name for this generation strategy. If not specified,
| strategy's name will be names of its nodes' generators joined with '+'.
|
| Method resolution order:
| GenerationStrategy
| ax.utils.common.base.Base
| builtins.object
|
| Methods defined here:
|
| __init__(self, steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self) -> 'str'
| String representation of this generation strategy.
|
| clone_reset(self) -> 'GenerationStrategy'
| Copy this generation strategy without it's state.
|
| current_generator_run_limit(self) -> 'tuple[int, bool]'
| First check if we can move the generation strategy to the next node, which
| is safe, as the next call to ``gen`` will just pick up from there. Then
| determine how many generator runs this generation strategy can generate right
| now, assuming each one of them becomes its own trial, and whether optimization
| is completed.
|
| Returns: a two-item tuple of:
| - the number of generator runs that can currently be produced, with -1
| meaning unlimited generator runs,
| - whether optimization is completed and the generation strategy cannot
| generate any more generator runs at all.
|
| gen(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int | None' = None, fixed_features: 'ObservationFeatures | None' = None, num_trials: 'int' = 1, arms_per_node: 'dict[str, int] | None' = None) -> 'list[list[GeneratorRun]]'
| Produce GeneratorRuns for multiple trials at once with the possibility of
| using multiple models per trial, getting multiple GeneratorRuns per trial.
|
| Args:
| experiment: ``Experiment``, for which the generation strategy is producing
| a new generator run in the course of ``gen``, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's ``gen``, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the ``experiment``.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
| n: Integer representing how many total arms should be in the generator
| runs produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output generator runs with number of
| arms that can differ from `n`.
| fixed_features: An optional set of ``ObservationFeatures`` that will be
| passed down to the underlying nodes. Note: if provided this will
| override any algorithmically determined fixed features so it is
| important to specify all necessary fixed features.
| num_trials: Number of trials to generate generator runs for in this call.
| If not provided, defaults to 1.
| arms_per_node: An optional map from node name to the number of arms to
| generate from that node. If not provided, will default to the number
| of arms specified in the node's ``InputConstructors`` or n if no
| ``InputConstructors`` are defined on the node. We expect either n or
| arms_per_node to be provided, but not both, and this is an advanced
| argument that should only be used by advanced users.
|
| Returns:
| A list of lists of lists generator runs. Each outer list represents
| a trial being suggested and each inner list represents a generator
| run for that trial.
|
| gen_single_trial(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int' = 1, fixed_features: 'ObservationFeatures | None' = None) -> 'GeneratorRun'
| Produce the next points in the experiment. Additional kwargs passed to
| this method are propagated directly to the underlying node's `gen`, along
| with the `model_gen_kwargs` set on the current generation node.
|
| NOTE: Each generator run returned from this function must become a single
| trial on the experiment to comply with assumptions made in generation
| strategy. Do not split one generator run produced from generation strategy
| into multiple trials (never making a generator run into a trial is allowed).
|
| Args:
| experiment: Experiment, for which the generation strategy is producing
| a new generator run in the course of `gen`, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's `gen`, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the `experiment`.
| n: Integer representing how many arms should be in the generator run
| produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output a generator run with number of
| arms that can differ from `n`.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| adapter
| The adapter from the current node of this strategy. Returns None
| if no adapter has been set yet. This can happen if no generator runs have
| been produced from this GS or if the current node does not utilize
| adapters (the case for ``ExternalGenerationNode``).
|
| current_node
| Current generation node.
|
| current_node_name
| Current generation node name.
|
| current_step
| Current generation step.
|
| current_step_index
| Returns the index of the current generation step. This attribute
| is replaced by node_name in newer GenerationStrategies but surfaced here
| for backward compatibility.
|
| is_node_based
| Whether this strategy consists of GenerationNodes only.
| This is useful for determining initialization properties and
| other logic.
|
| last_generator_run
| Latest generator run produced by this generation strategy.
| Returns None if no generator runs have been produced yet.
|
| name
| Name of this generation strategy.
|
| nodes_dict
| Returns a dictionary mapping node names to nodes.
|
| optimization_complete
| Checks whether all nodes are completed in the generation strategy.
|
| trials_as_df
| Puts information on individual trials into a data frame for easy
| viewing.
|
| THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
| Please use `Experiment.to_df()` instead.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| experiment
| Experiment, currently set on this generation strategy.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| DEFAULT_N = 1
|
| __annotations__ = {'DEFAULT_N': 'int', '_curr': 'GenerationNode', '_ex...
|
| ----------------------------------------------------------------------
| Methods inherited from ax.utils.common.base.Base:
|
| __eq__ = _type_safe_equals(self, other)
| # no type annotation for now; breaks sphinx-autodoc-typehints
| # pyre-fixme[3]: Return type must be annotated.
| # pyre-fixme[2]: Parameter must be annotated.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ax.utils.common.base.Base:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| db_id
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ax.utils.common.base.Base:
|
| __hash__ = None
!!!!! gs: GenerationStrategy(name='SOBOL for 1 step+BOTORCH_MODULAR for 1 step', nodes=[GenerationNode(node_name='SOBOL', generator_specs=[GeneratorSpec(generator_enum=Sobol, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')]), GenerationNode(node_name='BOTORCH_MODULAR', generator_specs=[GeneratorSpec(generator_enum=BoTorch, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')])]) !!!!
Help on GenerationStrategy in module ax.generation_strategy.generation_strategy object:
class GenerationStrategy(ax.utils.common.base.Base)
| GenerationStrategy(steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
|
| GenerationStrategy describes which node should be used to generate new
| points for which trials, enabling and automating use of different nodes
| throughout the optimization process. For instance, it allows to use one
| node for the initialization trials, and another one for all subsequent
| trials. In the general case, this allows to automate use of an arbitrary
| number of nodes to generate an arbitrary numbers of trials.
|
| Args:
| nodes: A list of `GenerationNode`. Each `GenerationNode` in the list
| represents a single node in a `GenerationStrategy` which, when
| composed of `GenerationNodes`, can be conceptualized as a graph instead
| of a linear list. `TransitionCriterion` defined in each `GenerationNode`
| represent the edges in the `GenerationStrategy` graph. `GenerationNodes`
| are more flexible than `GenerationSteps` and new `GenerationStrategies`
| should use nodes. Notably, either, but not both, of `nodes` and `steps`
| must be provided.
| steps: A list of `GenerationStep` describing steps of this strategy.
| name: An optional name for this generation strategy. If not specified,
| strategy's name will be names of its nodes' generators joined with '+'.
|
| Method resolution order:
| GenerationStrategy
| ax.utils.common.base.Base
| builtins.object
|
| Methods defined here:
|
| __init__(self, steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self) -> 'str'
| String representation of this generation strategy.
|
| clone_reset(self) -> 'GenerationStrategy'
| Copy this generation strategy without it's state.
|
| current_generator_run_limit(self) -> 'tuple[int, bool]'
| First check if we can move the generation strategy to the next node, which
| is safe, as the next call to ``gen`` will just pick up from there. Then
| determine how many generator runs this generation strategy can generate right
| now, assuming each one of them becomes its own trial, and whether optimization
| is completed.
|
| Returns: a two-item tuple of:
| - the number of generator runs that can currently be produced, with -1
| meaning unlimited generator runs,
| - whether optimization is completed and the generation strategy cannot
| generate any more generator runs at all.
|
| gen(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int | None' = None, fixed_features: 'ObservationFeatures | None' = None, num_trials: 'int' = 1, arms_per_node: 'dict[str, int] | None' = None) -> 'list[list[GeneratorRun]]'
| Produce GeneratorRuns for multiple trials at once with the possibility of
| using multiple models per trial, getting multiple GeneratorRuns per trial.
|
| Args:
| experiment: ``Experiment``, for which the generation strategy is producing
| a new generator run in the course of ``gen``, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's ``gen``, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the ``experiment``.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
| n: Integer representing how many total arms should be in the generator
| runs produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output generator runs with number of
| arms that can differ from `n`.
| fixed_features: An optional set of ``ObservationFeatures`` that will be
| passed down to the underlying nodes. Note: if provided this will
| override any algorithmically determined fixed features so it is
| important to specify all necessary fixed features.
| num_trials: Number of trials to generate generator runs for in this call.
| If not provided, defaults to 1.
| arms_per_node: An optional map from node name to the number of arms to
| generate from that node. If not provided, will default to the number
| of arms specified in the node's ``InputConstructors`` or n if no
| ``InputConstructors`` are defined on the node. We expect either n or
| arms_per_node to be provided, but not both, and this is an advanced
| argument that should only be used by advanced users.
|
| Returns:
| A list of lists of lists generator runs. Each outer list represents
| a trial being suggested and each inner list represents a generator
| run for that trial.
|
| gen_single_trial(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int' = 1, fixed_features: 'ObservationFeatures | None' = None) -> 'GeneratorRun'
| Produce the next points in the experiment. Additional kwargs passed to
| this method are propagated directly to the underlying node's `gen`, along
| with the `model_gen_kwargs` set on the current generation node.
|
| NOTE: Each generator run returned from this function must become a single
| trial on the experiment to comply with assumptions made in generation
| strategy. Do not split one generator run produced from generation strategy
| into multiple trials (never making a generator run into a trial is allowed).
|
| Args:
| experiment: Experiment, for which the generation strategy is producing
| a new generator run in the course of `gen`, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's `gen`, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the `experiment`.
| n: Integer representing how many arms should be in the generator run
| produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output a generator run with number of
| arms that can differ from `n`.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| adapter
| The adapter from the current node of this strategy. Returns None
| if no adapter has been set yet. This can happen if no generator runs have
| been produced from this GS or if the current node does not utilize
| adapters (the case for ``ExternalGenerationNode``).
|
| current_node
| Current generation node.
|
| current_node_name
| Current generation node name.
|
| current_step
| Current generation step.
|
| current_step_index
| Returns the index of the current generation step. This attribute
| is replaced by node_name in newer GenerationStrategies but surfaced here
| for backward compatibility.
|
| is_node_based
| Whether this strategy consists of GenerationNodes only.
| This is useful for determining initialization properties and
| other logic.
|
| last_generator_run
| Latest generator run produced by this generation strategy.
| Returns None if no generator runs have been produced yet.
|
| name
| Name of this generation strategy.
|
| nodes_dict
| Returns a dictionary mapping node names to nodes.
|
| optimization_complete
| Checks whether all nodes are completed in the generation strategy.
|
| trials_as_df
| Puts information on individual trials into a data frame for easy
| viewing.
|
| THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
| Please use `Experiment.to_df()` instead.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| experiment
| Experiment, currently set on this generation strategy.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| DEFAULT_N = 1
|
| __annotations__ = {'DEFAULT_N': 'int', '_curr': 'GenerationNode', '_ex...
|
| ----------------------------------------------------------------------
| Methods inherited from ax.utils.common.base.Base:
|
| __eq__ = _type_safe_equals(self, other)
| # no type annotation for now; breaks sphinx-autodoc-typehints
| # pyre-fixme[3]: Return type must be annotated.
| # pyre-fixme[2]: Parameter must be annotated.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ax.utils.common.base.Base:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| db_id
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ax.utils.common.base.Base:
|
| __hash__ = None
!!!!! gs: GenerationStrategy(name='SOBOL for 1 step+BOTORCH_MODULAR for 1 step', nodes=[GenerationNode(node_name='SOBOL', generator_specs=[GeneratorSpec(generator_enum=Sobol, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')]), GenerationNode(node_name='BOTORCH_MODULAR', generator_specs=[GeneratorSpec(generator_enum=BoTorch, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')])]) !!!!
Help on GenerationStrategy in module ax.generation_strategy.generation_strategy object:
class GenerationStrategy(ax.utils.common.base.Base)
| GenerationStrategy(steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
|
| GenerationStrategy describes which node should be used to generate new
| points for which trials, enabling and automating use of different nodes
| throughout the optimization process. For instance, it allows to use one
| node for the initialization trials, and another one for all subsequent
| trials. In the general case, this allows to automate use of an arbitrary
| number of nodes to generate an arbitrary numbers of trials.
|
| Args:
| nodes: A list of `GenerationNode`. Each `GenerationNode` in the list
| represents a single node in a `GenerationStrategy` which, when
| composed of `GenerationNodes`, can be conceptualized as a graph instead
| of a linear list. `TransitionCriterion` defined in each `GenerationNode`
| represent the edges in the `GenerationStrategy` graph. `GenerationNodes`
| are more flexible than `GenerationSteps` and new `GenerationStrategies`
| should use nodes. Notably, either, but not both, of `nodes` and `steps`
| must be provided.
| steps: A list of `GenerationStep` describing steps of this strategy.
| name: An optional name for this generation strategy. If not specified,
| strategy's name will be names of its nodes' generators joined with '+'.
|
| Method resolution order:
| GenerationStrategy
| ax.utils.common.base.Base
| builtins.object
|
| Methods defined here:
|
| __init__(self, steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self) -> 'str'
| String representation of this generation strategy.
|
| clone_reset(self) -> 'GenerationStrategy'
| Copy this generation strategy without it's state.
|
| current_generator_run_limit(self) -> 'tuple[int, bool]'
| First check if we can move the generation strategy to the next node, which
| is safe, as the next call to ``gen`` will just pick up from there. Then
| determine how many generator runs this generation strategy can generate right
| now, assuming each one of them becomes its own trial, and whether optimization
| is completed.
|
| Returns: a two-item tuple of:
| - the number of generator runs that can currently be produced, with -1
| meaning unlimited generator runs,
| - whether optimization is completed and the generation strategy cannot
| generate any more generator runs at all.
|
| gen(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int | None' = None, fixed_features: 'ObservationFeatures | None' = None, num_trials: 'int' = 1, arms_per_node: 'dict[str, int] | None' = None) -> 'list[list[GeneratorRun]]'
| Produce GeneratorRuns for multiple trials at once with the possibility of
| using multiple models per trial, getting multiple GeneratorRuns per trial.
|
| Args:
| experiment: ``Experiment``, for which the generation strategy is producing
| a new generator run in the course of ``gen``, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's ``gen``, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the ``experiment``.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
| n: Integer representing how many total arms should be in the generator
| runs produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output generator runs with number of
| arms that can differ from `n`.
| fixed_features: An optional set of ``ObservationFeatures`` that will be
| passed down to the underlying nodes. Note: if provided this will
| override any algorithmically determined fixed features so it is
| important to specify all necessary fixed features.
| num_trials: Number of trials to generate generator runs for in this call.
| If not provided, defaults to 1.
| arms_per_node: An optional map from node name to the number of arms to
| generate from that node. If not provided, will default to the number
| of arms specified in the node's ``InputConstructors`` or n if no
| ``InputConstructors`` are defined on the node. We expect either n or
| arms_per_node to be provided, but not both, and this is an advanced
| argument that should only be used by advanced users.
|
| Returns:
| A list of lists of lists generator runs. Each outer list represents
| a trial being suggested and each inner list represents a generator
| run for that trial.
|
| gen_single_trial(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int' = 1, fixed_features: 'ObservationFeatures | None' = None) -> 'GeneratorRun'
| Produce the next points in the experiment. Additional kwargs passed to
| this method are propagated directly to the underlying node's `gen`, along
| with the `model_gen_kwargs` set on the current generation node.
|
| NOTE: Each generator run returned from this function must become a single
| trial on the experiment to comply with assumptions made in generation
| strategy. Do not split one generator run produced from generation strategy
| into multiple trials (never making a generator run into a trial is allowed).
|
| Args:
| experiment: Experiment, for which the generation strategy is producing
| a new generator run in the course of `gen`, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's `gen`, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the `experiment`.
| n: Integer representing how many arms should be in the generator run
| produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output a generator run with number of
| arms that can differ from `n`.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| adapter
| The adapter from the current node of this strategy. Returns None
| if no adapter has been set yet. This can happen if no generator runs have
| been produced from this GS or if the current node does not utilize
| adapters (the case for ``ExternalGenerationNode``).
|
| current_node
| Current generation node.
|
| current_node_name
| Current generation node name.
|
| current_step
| Current generation step.
|
| current_step_index
| Returns the index of the current generation step. This attribute
| is replaced by node_name in newer GenerationStrategies but surfaced here
| for backward compatibility.
|
| is_node_based
| Whether this strategy consists of GenerationNodes only.
| This is useful for determining initialization properties and
| other logic.
|
| last_generator_run
| Latest generator run produced by this generation strategy.
| Returns None if no generator runs have been produced yet.
|
| name
| Name of this generation strategy.
|
| nodes_dict
| Returns a dictionary mapping node names to nodes.
|
| optimization_complete
| Checks whether all nodes are completed in the generation strategy.
|
| trials_as_df
| Puts information on individual trials into a data frame for easy
| viewing.
|
| THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
| Please use `Experiment.to_df()` instead.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| experiment
| Experiment, currently set on this generation strategy.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| DEFAULT_N = 1
|
| __annotations__ = {'DEFAULT_N': 'int', '_curr': 'GenerationNode', '_ex...
|
| ----------------------------------------------------------------------
| Methods inherited from ax.utils.common.base.Base:
|
| __eq__ = _type_safe_equals(self, other)
| # no type annotation for now; breaks sphinx-autodoc-typehints
| # pyre-fixme[3]: Return type must be annotated.
| # pyre-fixme[2]: Parameter must be annotated.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ax.utils.common.base.Base:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| db_id
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ax.utils.common.base.Base:
|
| __hash__ = None
!!!!! gs: GenerationStrategy(name='SOBOL for 1 step+BOTORCH_MODULAR for 1 step', nodes=[GenerationNode(node_name='SOBOL', generator_specs=[GeneratorSpec(generator_enum=Sobol, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')]), GenerationNode(node_name='BOTORCH_MODULAR', generator_specs=[GeneratorSpec(generator_enum=BoTorch, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')])]) !!!!
Help on GenerationStrategy in module ax.generation_strategy.generation_strategy object:
class GenerationStrategy(ax.utils.common.base.Base)
| GenerationStrategy(steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
|
| GenerationStrategy describes which node should be used to generate new
| points for which trials, enabling and automating use of different nodes
| throughout the optimization process. For instance, it allows to use one
| node for the initialization trials, and another one for all subsequent
| trials. In the general case, this allows to automate use of an arbitrary
| number of nodes to generate an arbitrary numbers of trials.
|
| Args:
| nodes: A list of `GenerationNode`. Each `GenerationNode` in the list
| represents a single node in a `GenerationStrategy` which, when
| composed of `GenerationNodes`, can be conceptualized as a graph instead
| of a linear list. `TransitionCriterion` defined in each `GenerationNode`
| represent the edges in the `GenerationStrategy` graph. `GenerationNodes`
| are more flexible than `GenerationSteps` and new `GenerationStrategies`
| should use nodes. Notably, either, but not both, of `nodes` and `steps`
| must be provided.
| steps: A list of `GenerationStep` describing steps of this strategy.
| name: An optional name for this generation strategy. If not specified,
| strategy's name will be names of its nodes' generators joined with '+'.
|
| Method resolution order:
| GenerationStrategy
| ax.utils.common.base.Base
| builtins.object
|
| Methods defined here:
|
| __init__(self, steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self) -> 'str'
| String representation of this generation strategy.
|
| clone_reset(self) -> 'GenerationStrategy'
| Copy this generation strategy without it's state.
|
| current_generator_run_limit(self) -> 'tuple[int, bool]'
| First check if we can move the generation strategy to the next node, which
| is safe, as the next call to ``gen`` will just pick up from there. Then
| determine how many generator runs this generation strategy can generate right
| now, assuming each one of them becomes its own trial, and whether optimization
| is completed.
|
| Returns: a two-item tuple of:
| - the number of generator runs that can currently be produced, with -1
| meaning unlimited generator runs,
| - whether optimization is completed and the generation strategy cannot
| generate any more generator runs at all.
|
| gen(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int | None' = None, fixed_features: 'ObservationFeatures | None' = None, num_trials: 'int' = 1, arms_per_node: 'dict[str, int] | None' = None) -> 'list[list[GeneratorRun]]'
| Produce GeneratorRuns for multiple trials at once with the possibility of
| using multiple models per trial, getting multiple GeneratorRuns per trial.
|
| Args:
| experiment: ``Experiment``, for which the generation strategy is producing
| a new generator run in the course of ``gen``, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's ``gen``, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the ``experiment``.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
| n: Integer representing how many total arms should be in the generator
| runs produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output generator runs with number of
| arms that can differ from `n`.
| fixed_features: An optional set of ``ObservationFeatures`` that will be
| passed down to the underlying nodes. Note: if provided this will
| override any algorithmically determined fixed features so it is
| important to specify all necessary fixed features.
| num_trials: Number of trials to generate generator runs for in this call.
| If not provided, defaults to 1.
| arms_per_node: An optional map from node name to the number of arms to
| generate from that node. If not provided, will default to the number
| of arms specified in the node's ``InputConstructors`` or n if no
| ``InputConstructors`` are defined on the node. We expect either n or
| arms_per_node to be provided, but not both, and this is an advanced
| argument that should only be used by advanced users.
|
| Returns:
| A list of lists of lists generator runs. Each outer list represents
| a trial being suggested and each inner list represents a generator
| run for that trial.
|
| gen_single_trial(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int' = 1, fixed_features: 'ObservationFeatures | None' = None) -> 'GeneratorRun'
| Produce the next points in the experiment. Additional kwargs passed to
| this method are propagated directly to the underlying node's `gen`, along
| with the `model_gen_kwargs` set on the current generation node.
|
| NOTE: Each generator run returned from this function must become a single
| trial on the experiment to comply with assumptions made in generation
| strategy. Do not split one generator run produced from generation strategy
| into multiple trials (never making a generator run into a trial is allowed).
|
| Args:
| experiment: Experiment, for which the generation strategy is producing
| a new generator run in the course of `gen`, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's `gen`, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the `experiment`.
| n: Integer representing how many arms should be in the generator run
| produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output a generator run with number of
| arms that can differ from `n`.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| adapter
| The adapter from the current node of this strategy. Returns None
| if no adapter has been set yet. This can happen if no generator runs have
| been produced from this GS or if the current node does not utilize
| adapters (the case for ``ExternalGenerationNode``).
|
| current_node
| Current generation node.
|
| current_node_name
| Current generation node name.
|
| current_step
| Current generation step.
|
| current_step_index
| Returns the index of the current generation step. This attribute
| is replaced by node_name in newer GenerationStrategies but surfaced here
| for backward compatibility.
|
| is_node_based
| Whether this strategy consists of GenerationNodes only.
| This is useful for determining initialization properties and
| other logic.
|
| last_generator_run
| Latest generator run produced by this generation strategy.
| Returns None if no generator runs have been produced yet.
|
| name
| Name of this generation strategy.
|
| nodes_dict
| Returns a dictionary mapping node names to nodes.
|
| optimization_complete
| Checks whether all nodes are completed in the generation strategy.
|
| trials_as_df
| Puts information on individual trials into a data frame for easy
| viewing.
|
| THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
| Please use `Experiment.to_df()` instead.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| experiment
| Experiment, currently set on this generation strategy.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| DEFAULT_N = 1
|
| __annotations__ = {'DEFAULT_N': 'int', '_curr': 'GenerationNode', '_ex...
|
| ----------------------------------------------------------------------
| Methods inherited from ax.utils.common.base.Base:
|
| __eq__ = _type_safe_equals(self, other)
| # no type annotation for now; breaks sphinx-autodoc-typehints
| # pyre-fixme[3]: Return type must be annotated.
| # pyre-fixme[2]: Parameter must be annotated.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ax.utils.common.base.Base:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| db_id
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ax.utils.common.base.Base:
|
| __hash__ = None
!!!!! gs: GenerationStrategy(name='SOBOL for 1 step+BOTORCH_MODULAR for 1 step', nodes=[GenerationNode(node_name='SOBOL', generator_specs=[GeneratorSpec(generator_enum=Sobol, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')]), GenerationNode(node_name='BOTORCH_MODULAR', generator_specs=[GeneratorSpec(generator_enum=BoTorch, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')])]) !!!!
SOBOL, new result: RESULT: -141818.478726 : 50%|█████░░░░░| 1/2 [00:11 'None'
|
| GenerationStrategy describes which node should be used to generate new
| points for which trials, enabling and automating use of different nodes
| throughout the optimization process. For instance, it allows to use one
| node for the initialization trials, and another one for all subsequent
| trials. In the general case, this allows to automate use of an arbitrary
| number of nodes to generate an arbitrary numbers of trials.
|
| Args:
| nodes: A list of `GenerationNode`. Each `GenerationNode` in the list
| represents a single node in a `GenerationStrategy` which, when
| composed of `GenerationNodes`, can be conceptualized as a graph instead
| of a linear list. `TransitionCriterion` defined in each `GenerationNode`
| represent the edges in the `GenerationStrategy` graph. `GenerationNodes`
| are more flexible than `GenerationSteps` and new `GenerationStrategies`
| should use nodes. Notably, either, but not both, of `nodes` and `steps`
| must be provided.
| steps: A list of `GenerationStep` describing steps of this strategy.
| name: An optional name for this generation strategy. If not specified,
| strategy's name will be names of its nodes' generators joined with '+'.
|
| Method resolution order:
| GenerationStrategy
| ax.utils.common.base.Base
| builtins.object
|
| Methods defined here:
|
| __init__(self, steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self) -> 'str'
| String representation of this generation strategy.
|
| clone_reset(self) -> 'GenerationStrategy'
| Copy this generation strategy without it's state.
|
| current_generator_run_limit(self) -> 'tuple[int, bool]'
| First check if we can move the generation strategy to the next node, which
| is safe, as the next call to ``gen`` will just pick up from there. Then
| determine how many generator runs this generation strategy can generate right
| now, assuming each one of them becomes its own trial, and whether optimization
| is completed.
|
| Returns: a two-item tuple of:
| - the number of generator runs that can currently be produced, with -1
| meaning unlimited generator runs,
| - whether optimization is completed and the generation strategy cannot
| generate any more generator runs at all.
|
| gen(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int | None' = None, fixed_features: 'ObservationFeatures | None' = None, num_trials: 'int' = 1, arms_per_node: 'dict[str, int] | None' = None) -> 'list[list[GeneratorRun]]'
| Produce GeneratorRuns for multiple trials at once with the possibility of
| using multiple models per trial, getting multiple GeneratorRuns per trial.
|
| Args:
| experiment: ``Experiment``, for which the generation strategy is producing
| a new generator run in the course of ``gen``, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's ``gen``, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the ``experiment``.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
| n: Integer representing how many total arms should be in the generator
| runs produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output generator runs with number of
| arms that can differ from `n`.
| fixed_features: An optional set of ``ObservationFeatures`` that will be
| passed down to the underlying nodes. Note: if provided this will
| override any algorithmically determined fixed features so it is
| important to specify all necessary fixed features.
| num_trials: Number of trials to generate generator runs for in this call.
| If not provided, defaults to 1.
| arms_per_node: An optional map from node name to the number of arms to
| generate from that node. If not provided, will default to the number
| of arms specified in the node's ``InputConstructors`` or n if no
| ``InputConstructors`` are defined on the node. We expect either n or
| arms_per_node to be provided, but not both, and this is an advanced
| argument that should only be used by advanced users.
|
| Returns:
| A list of lists of lists generator runs. Each outer list represents
| a trial being suggested and each inner list represents a generator
| run for that trial.
|
| gen_single_trial(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int' = 1, fixed_features: 'ObservationFeatures | None' = None) -> 'GeneratorRun'
| Produce the next points in the experiment. Additional kwargs passed to
| this method are propagated directly to the underlying node's `gen`, along
| with the `model_gen_kwargs` set on the current generation node.
|
| NOTE: Each generator run returned from this function must become a single
| trial on the experiment to comply with assumptions made in generation
| strategy. Do not split one generator run produced from generation strategy
| into multiple trials (never making a generator run into a trial is allowed).
|
| Args:
| experiment: Experiment, for which the generation strategy is producing
| a new generator run in the course of `gen`, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's `gen`, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the `experiment`.
| n: Integer representing how many arms should be in the generator run
| produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output a generator run with number of
| arms that can differ from `n`.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| adapter
| The adapter from the current node of this strategy. Returns None
| if no adapter has been set yet. This can happen if no generator runs have
| been produced from this GS or if the current node does not utilize
| adapters (the case for ``ExternalGenerationNode``).
|
| current_node
| Current generation node.
|
| current_node_name
| Current generation node name.
|
| current_step
| Current generation step.
|
| current_step_index
| Returns the index of the current generation step. This attribute
| is replaced by node_name in newer GenerationStrategies but surfaced here
| for backward compatibility.
|
| is_node_based
| Whether this strategy consists of GenerationNodes only.
| This is useful for determining initialization properties and
| other logic.
|
| last_generator_run
| Latest generator run produced by this generation strategy.
| Returns None if no generator runs have been produced yet.
|
| name
| Name of this generation strategy.
|
| nodes_dict
| Returns a dictionary mapping node names to nodes.
|
| optimization_complete
| Checks whether all nodes are completed in the generation strategy.
|
| trials_as_df
| Puts information on individual trials into a data frame for easy
| viewing.
|
| THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
| Please use `Experiment.to_df()` instead.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| experiment
| Experiment, currently set on this generation strategy.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| DEFAULT_N = 1
|
| __annotations__ = {'DEFAULT_N': 'int', '_curr': 'GenerationNode', '_ex...
|
| ----------------------------------------------------------------------
| Methods inherited from ax.utils.common.base.Base:
|
| __eq__ = _type_safe_equals(self, other)
| # no type annotation for now; breaks sphinx-autodoc-typehints
| # pyre-fixme[3]: Return type must be annotated.
| # pyre-fixme[2]: Parameter must be annotated.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ax.utils.common.base.Base:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| db_id
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ax.utils.common.base.Base:
|
| __hash__ = None
!!!!! gs: GenerationStrategy(name='SOBOL for 1 step+BOTORCH_MODULAR for 1 step', nodes=[GenerationNode(node_name='SOBOL', generator_specs=[GeneratorSpec(generator_enum=Sobol, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')]), GenerationNode(node_name='BOTORCH_MODULAR', generator_specs=[GeneratorSpec(generator_enum=BoTorch, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')])]) !!!!
SOBOL, best RESULT: -141818.478726083, finishing jobs, finished 1 job: 50%|█████░░░░░| 1/2 [00:17 'None'
|
| GenerationStrategy describes which node should be used to generate new
| points for which trials, enabling and automating use of different nodes
| throughout the optimization process. For instance, it allows to use one
| node for the initialization trials, and another one for all subsequent
| trials. In the general case, this allows to automate use of an arbitrary
| number of nodes to generate an arbitrary numbers of trials.
|
| Args:
| nodes: A list of `GenerationNode`. Each `GenerationNode` in the list
| represents a single node in a `GenerationStrategy` which, when
| composed of `GenerationNodes`, can be conceptualized as a graph instead
| of a linear list. `TransitionCriterion` defined in each `GenerationNode`
| represent the edges in the `GenerationStrategy` graph. `GenerationNodes`
| are more flexible than `GenerationSteps` and new `GenerationStrategies`
| should use nodes. Notably, either, but not both, of `nodes` and `steps`
| must be provided.
| steps: A list of `GenerationStep` describing steps of this strategy.
| name: An optional name for this generation strategy. If not specified,
| strategy's name will be names of its nodes' generators joined with '+'.
|
| Method resolution order:
| GenerationStrategy
| ax.utils.common.base.Base
| builtins.object
|
| Methods defined here:
|
| __init__(self, steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self) -> 'str'
| String representation of this generation strategy.
|
| clone_reset(self) -> 'GenerationStrategy'
| Copy this generation strategy without it's state.
|
| current_generator_run_limit(self) -> 'tuple[int, bool]'
| First check if we can move the generation strategy to the next node, which
| is safe, as the next call to ``gen`` will just pick up from there. Then
| determine how many generator runs this generation strategy can generate right
| now, assuming each one of them becomes its own trial, and whether optimization
| is completed.
|
| Returns: a two-item tuple of:
| - the number of generator runs that can currently be produced, with -1
| meaning unlimited generator runs,
| - whether optimization is completed and the generation strategy cannot
| generate any more generator runs at all.
|
| gen(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int | None' = None, fixed_features: 'ObservationFeatures | None' = None, num_trials: 'int' = 1, arms_per_node: 'dict[str, int] | None' = None) -> 'list[list[GeneratorRun]]'
| Produce GeneratorRuns for multiple trials at once with the possibility of
| using multiple models per trial, getting multiple GeneratorRuns per trial.
|
| Args:
| experiment: ``Experiment``, for which the generation strategy is producing
| a new generator run in the course of ``gen``, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's ``gen``, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the ``experiment``.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
| n: Integer representing how many total arms should be in the generator
| runs produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output generator runs with number of
| arms that can differ from `n`.
| fixed_features: An optional set of ``ObservationFeatures`` that will be
| passed down to the underlying nodes. Note: if provided this will
| override any algorithmically determined fixed features so it is
| important to specify all necessary fixed features.
| num_trials: Number of trials to generate generator runs for in this call.
| If not provided, defaults to 1.
| arms_per_node: An optional map from node name to the number of arms to
| generate from that node. If not provided, will default to the number
| of arms specified in the node's ``InputConstructors`` or n if no
| ``InputConstructors`` are defined on the node. We expect either n or
| arms_per_node to be provided, but not both, and this is an advanced
| argument that should only be used by advanced users.
|
| Returns:
| A list of lists of lists generator runs. Each outer list represents
| a trial being suggested and each inner list represents a generator
| run for that trial.
|
| gen_single_trial(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int' = 1, fixed_features: 'ObservationFeatures | None' = None) -> 'GeneratorRun'
| Produce the next points in the experiment. Additional kwargs passed to
| this method are propagated directly to the underlying node's `gen`, along
| with the `model_gen_kwargs` set on the current generation node.
|
| NOTE: Each generator run returned from this function must become a single
| trial on the experiment to comply with assumptions made in generation
| strategy. Do not split one generator run produced from generation strategy
| into multiple trials (never making a generator run into a trial is allowed).
|
| Args:
| experiment: Experiment, for which the generation strategy is producing
| a new generator run in the course of `gen`, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's `gen`, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the `experiment`.
| n: Integer representing how many arms should be in the generator run
| produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output a generator run with number of
| arms that can differ from `n`.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| adapter
| The adapter from the current node of this strategy. Returns None
| if no adapter has been set yet. This can happen if no generator runs have
| been produced from this GS or if the current node does not utilize
| adapters (the case for ``ExternalGenerationNode``).
|
| current_node
| Current generation node.
|
| current_node_name
| Current generation node name.
|
| current_step
| Current generation step.
|
| current_step_index
| Returns the index of the current generation step. This attribute
| is replaced by node_name in newer GenerationStrategies but surfaced here
| for backward compatibility.
|
| is_node_based
| Whether this strategy consists of GenerationNodes only.
| This is useful for determining initialization properties and
| other logic.
|
| last_generator_run
| Latest generator run produced by this generation strategy.
| Returns None if no generator runs have been produced yet.
|
| name
| Name of this generation strategy.
|
| nodes_dict
| Returns a dictionary mapping node names to nodes.
|
| optimization_complete
| Checks whether all nodes are completed in the generation strategy.
|
| trials_as_df
| Puts information on individual trials into a data frame for easy
| viewing.
|
| THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
| Please use `Experiment.to_df()` instead.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| experiment
| Experiment, currently set on this generation strategy.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| DEFAULT_N = 1
|
| __annotations__ = {'DEFAULT_N': 'int', '_curr': 'GenerationNode', '_ex...
|
| ----------------------------------------------------------------------
| Methods inherited from ax.utils.common.base.Base:
|
| __eq__ = _type_safe_equals(self, other)
| # no type annotation for now; breaks sphinx-autodoc-typehints
| # pyre-fixme[3]: Return type must be annotated.
| # pyre-fixme[2]: Parameter must be annotated.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ax.utils.common.base.Base:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| db_id
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ax.utils.common.base.Base:
|
| __hash__ = None
!!!!! gs: GenerationStrategy(name='SOBOL for 1 step+BOTORCH_MODULAR for 1 step', nodes=[GenerationNode(node_name='SOBOL', generator_specs=[GeneratorSpec(generator_enum=Sobol, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')]), GenerationNode(node_name='BOTORCH_MODULAR', generator_specs=[GeneratorSpec(generator_enum=BoTorch, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')])]) !!!!
Help on GenerationStrategy in module ax.generation_strategy.generation_strategy object:
class GenerationStrategy(ax.utils.common.base.Base)
| GenerationStrategy(steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
|
| GenerationStrategy describes which node should be used to generate new
| points for which trials, enabling and automating use of different nodes
| throughout the optimization process. For instance, it allows to use one
| node for the initialization trials, and another one for all subsequent
| trials. In the general case, this allows to automate use of an arbitrary
| number of nodes to generate an arbitrary numbers of trials.
|
| Args:
| nodes: A list of `GenerationNode`. Each `GenerationNode` in the list
| represents a single node in a `GenerationStrategy` which, when
| composed of `GenerationNodes`, can be conceptualized as a graph instead
| of a linear list. `TransitionCriterion` defined in each `GenerationNode`
| represent the edges in the `GenerationStrategy` graph. `GenerationNodes`
| are more flexible than `GenerationSteps` and new `GenerationStrategies`
| should use nodes. Notably, either, but not both, of `nodes` and `steps`
| must be provided.
| steps: A list of `GenerationStep` describing steps of this strategy.
| name: An optional name for this generation strategy. If not specified,
| strategy's name will be names of its nodes' generators joined with '+'.
|
| Method resolution order:
| GenerationStrategy
| ax.utils.common.base.Base
| builtins.object
|
| Methods defined here:
|
| __init__(self, steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self) -> 'str'
| String representation of this generation strategy.
|
| clone_reset(self) -> 'GenerationStrategy'
| Copy this generation strategy without it's state.
|
| current_generator_run_limit(self) -> 'tuple[int, bool]'
| First check if we can move the generation strategy to the next node, which
| is safe, as the next call to ``gen`` will just pick up from there. Then
| determine how many generator runs this generation strategy can generate right
| now, assuming each one of them becomes its own trial, and whether optimization
| is completed.
|
| Returns: a two-item tuple of:
| - the number of generator runs that can currently be produced, with -1
| meaning unlimited generator runs,
| - whether optimization is completed and the generation strategy cannot
| generate any more generator runs at all.
|
| gen(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int | None' = None, fixed_features: 'ObservationFeatures | None' = None, num_trials: 'int' = 1, arms_per_node: 'dict[str, int] | None' = None) -> 'list[list[GeneratorRun]]'
| Produce GeneratorRuns for multiple trials at once with the possibility of
| using multiple models per trial, getting multiple GeneratorRuns per trial.
|
| Args:
| experiment: ``Experiment``, for which the generation strategy is producing
| a new generator run in the course of ``gen``, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's ``gen``, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the ``experiment``.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
| n: Integer representing how many total arms should be in the generator
| runs produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output generator runs with number of
| arms that can differ from `n`.
| fixed_features: An optional set of ``ObservationFeatures`` that will be
| passed down to the underlying nodes. Note: if provided this will
| override any algorithmically determined fixed features so it is
| important to specify all necessary fixed features.
| num_trials: Number of trials to generate generator runs for in this call.
| If not provided, defaults to 1.
| arms_per_node: An optional map from node name to the number of arms to
| generate from that node. If not provided, will default to the number
| of arms specified in the node's ``InputConstructors`` or n if no
| ``InputConstructors`` are defined on the node. We expect either n or
| arms_per_node to be provided, but not both, and this is an advanced
| argument that should only be used by advanced users.
|
| Returns:
| A list of lists of lists generator runs. Each outer list represents
| a trial being suggested and each inner list represents a generator
| run for that trial.
|
| gen_single_trial(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int' = 1, fixed_features: 'ObservationFeatures | None' = None) -> 'GeneratorRun'
| Produce the next points in the experiment. Additional kwargs passed to
| this method are propagated directly to the underlying node's `gen`, along
| with the `model_gen_kwargs` set on the current generation node.
|
| NOTE: Each generator run returned from this function must become a single
| trial on the experiment to comply with assumptions made in generation
| strategy. Do not split one generator run produced from generation strategy
| into multiple trials (never making a generator run into a trial is allowed).
|
| Args:
| experiment: Experiment, for which the generation strategy is producing
| a new generator run in the course of `gen`, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's `gen`, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the `experiment`.
| n: Integer representing how many arms should be in the generator run
| produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output a generator run with number of
| arms that can differ from `n`.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| adapter
| The adapter from the current node of this strategy. Returns None
| if no adapter has been set yet. This can happen if no generator runs have
| been produced from this GS or if the current node does not utilize
| adapters (the case for ``ExternalGenerationNode``).
|
| current_node
| Current generation node.
|
| current_node_name
| Current generation node name.
|
| current_step
| Current generation step.
|
| current_step_index
| Returns the index of the current generation step. This attribute
| is replaced by node_name in newer GenerationStrategies but surfaced here
| for backward compatibility.
|
| is_node_based
| Whether this strategy consists of GenerationNodes only.
| This is useful for determining initialization properties and
| other logic.
|
| last_generator_run
| Latest generator run produced by this generation strategy.
| Returns None if no generator runs have been produced yet.
|
| name
| Name of this generation strategy.
|
| nodes_dict
| Returns a dictionary mapping node names to nodes.
|
| optimization_complete
| Checks whether all nodes are completed in the generation strategy.
|
| trials_as_df
| Puts information on individual trials into a data frame for easy
| viewing.
|
| THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
| Please use `Experiment.to_df()` instead.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| experiment
| Experiment, currently set on this generation strategy.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| DEFAULT_N = 1
|
| __annotations__ = {'DEFAULT_N': 'int', '_curr': 'GenerationNode', '_ex...
|
| ----------------------------------------------------------------------
| Methods inherited from ax.utils.common.base.Base:
|
| __eq__ = _type_safe_equals(self, other)
| # no type annotation for now; breaks sphinx-autodoc-typehints
| # pyre-fixme[3]: Return type must be annotated.
| # pyre-fixme[2]: Parameter must be annotated.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ax.utils.common.base.Base:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| db_id
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ax.utils.common.base.Base:
|
| __hash__ = None
!!!!! gs: GenerationStrategy(name='SOBOL for 1 step+BOTORCH_MODULAR for 1 step', nodes=[GenerationNode(node_name='SOBOL', generator_specs=[GeneratorSpec(generator_enum=Sobol, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')]), GenerationNode(node_name='BOTORCH_MODULAR', generator_specs=[GeneratorSpec(generator_enum=BoTorch, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')])]) !!!!
Help on GenerationStrategy in module ax.generation_strategy.generation_strategy object:
class GenerationStrategy(ax.utils.common.base.Base)
| GenerationStrategy(steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
|
| GenerationStrategy describes which node should be used to generate new
| points for which trials, enabling and automating use of different nodes
| throughout the optimization process. For instance, it allows to use one
| node for the initialization trials, and another one for all subsequent
| trials. In the general case, this allows to automate use of an arbitrary
| number of nodes to generate an arbitrary numbers of trials.
|
| Args:
| nodes: A list of `GenerationNode`. Each `GenerationNode` in the list
| represents a single node in a `GenerationStrategy` which, when
| composed of `GenerationNodes`, can be conceptualized as a graph instead
| of a linear list. `TransitionCriterion` defined in each `GenerationNode`
| represent the edges in the `GenerationStrategy` graph. `GenerationNodes`
| are more flexible than `GenerationSteps` and new `GenerationStrategies`
| should use nodes. Notably, either, but not both, of `nodes` and `steps`
| must be provided.
| steps: A list of `GenerationStep` describing steps of this strategy.
| name: An optional name for this generation strategy. If not specified,
| strategy's name will be names of its nodes' generators joined with '+'.
|
| Method resolution order:
| GenerationStrategy
| ax.utils.common.base.Base
| builtins.object
|
| Methods defined here:
|
| __init__(self, steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self) -> 'str'
| String representation of this generation strategy.
|
| clone_reset(self) -> 'GenerationStrategy'
| Copy this generation strategy without it's state.
|
| current_generator_run_limit(self) -> 'tuple[int, bool]'
| First check if we can move the generation strategy to the next node, which
| is safe, as the next call to ``gen`` will just pick up from there. Then
| determine how many generator runs this generation strategy can generate right
| now, assuming each one of them becomes its own trial, and whether optimization
| is completed.
|
| Returns: a two-item tuple of:
| - the number of generator runs that can currently be produced, with -1
| meaning unlimited generator runs,
| - whether optimization is completed and the generation strategy cannot
| generate any more generator runs at all.
|
| gen(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int | None' = None, fixed_features: 'ObservationFeatures | None' = None, num_trials: 'int' = 1, arms_per_node: 'dict[str, int] | None' = None) -> 'list[list[GeneratorRun]]'
| Produce GeneratorRuns for multiple trials at once with the possibility of
| using multiple models per trial, getting multiple GeneratorRuns per trial.
|
| Args:
| experiment: ``Experiment``, for which the generation strategy is producing
| a new generator run in the course of ``gen``, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's ``gen``, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the ``experiment``.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
| n: Integer representing how many total arms should be in the generator
| runs produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output generator runs with number of
| arms that can differ from `n`.
| fixed_features: An optional set of ``ObservationFeatures`` that will be
| passed down to the underlying nodes. Note: if provided this will
| override any algorithmically determined fixed features so it is
| important to specify all necessary fixed features.
| num_trials: Number of trials to generate generator runs for in this call.
| If not provided, defaults to 1.
| arms_per_node: An optional map from node name to the number of arms to
| generate from that node. If not provided, will default to the number
| of arms specified in the node's ``InputConstructors`` or n if no
| ``InputConstructors`` are defined on the node. We expect either n or
| arms_per_node to be provided, but not both, and this is an advanced
| argument that should only be used by advanced users.
|
| Returns:
| A list of lists of lists generator runs. Each outer list represents
| a trial being suggested and each inner list represents a generator
| run for that trial.
|
| gen_single_trial(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int' = 1, fixed_features: 'ObservationFeatures | None' = None) -> 'GeneratorRun'
| Produce the next points in the experiment. Additional kwargs passed to
| this method are propagated directly to the underlying node's `gen`, along
| with the `model_gen_kwargs` set on the current generation node.
|
| NOTE: Each generator run returned from this function must become a single
| trial on the experiment to comply with assumptions made in generation
| strategy. Do not split one generator run produced from generation strategy
| into multiple trials (never making a generator run into a trial is allowed).
|
| Args:
| experiment: Experiment, for which the generation strategy is producing
| a new generator run in the course of `gen`, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's `gen`, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the `experiment`.
| n: Integer representing how many arms should be in the generator run
| produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output a generator run with number of
| arms that can differ from `n`.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| adapter
| The adapter from the current node of this strategy. Returns None
| if no adapter has been set yet. This can happen if no generator runs have
| been produced from this GS or if the current node does not utilize
| adapters (the case for ``ExternalGenerationNode``).
|
| current_node
| Current generation node.
|
| current_node_name
| Current generation node name.
|
| current_step
| Current generation step.
|
| current_step_index
| Returns the index of the current generation step. This attribute
| is replaced by node_name in newer GenerationStrategies but surfaced here
| for backward compatibility.
|
| is_node_based
| Whether this strategy consists of GenerationNodes only.
| This is useful for determining initialization properties and
| other logic.
|
| last_generator_run
| Latest generator run produced by this generation strategy.
| Returns None if no generator runs have been produced yet.
|
| name
| Name of this generation strategy.
|
| nodes_dict
| Returns a dictionary mapping node names to nodes.
|
| optimization_complete
| Checks whether all nodes are completed in the generation strategy.
|
| trials_as_df
| Puts information on individual trials into a data frame for easy
| viewing.
|
| THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
| Please use `Experiment.to_df()` instead.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| experiment
| Experiment, currently set on this generation strategy.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| DEFAULT_N = 1
|
| __annotations__ = {'DEFAULT_N': 'int', '_curr': 'GenerationNode', '_ex...
|
| ----------------------------------------------------------------------
| Methods inherited from ax.utils.common.base.Base:
|
| __eq__ = _type_safe_equals(self, other)
| # no type annotation for now; breaks sphinx-autodoc-typehints
| # pyre-fixme[3]: Return type must be annotated.
| # pyre-fixme[2]: Parameter must be annotated.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ax.utils.common.base.Base:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| db_id
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ax.utils.common.base.Base:
|
| __hash__ = None
!!!!! gs: GenerationStrategy(name='SOBOL for 1 step+BOTORCH_MODULAR for 1 step', nodes=[GenerationNode(node_name='SOBOL', generator_specs=[GeneratorSpec(generator_enum=Sobol, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')]), GenerationNode(node_name='BOTORCH_MODULAR', generator_specs=[GeneratorSpec(generator_enum=BoTorch, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')])]) !!!!
Help on GenerationStrategy in module ax.generation_strategy.generation_strategy object:
class GenerationStrategy(ax.utils.common.base.Base)
| GenerationStrategy(steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
|
| GenerationStrategy describes which node should be used to generate new
| points for which trials, enabling and automating use of different nodes
| throughout the optimization process. For instance, it allows to use one
| node for the initialization trials, and another one for all subsequent
| trials. In the general case, this allows to automate use of an arbitrary
| number of nodes to generate an arbitrary numbers of trials.
|
| Args:
| nodes: A list of `GenerationNode`. Each `GenerationNode` in the list
| represents a single node in a `GenerationStrategy` which, when
| composed of `GenerationNodes`, can be conceptualized as a graph instead
| of a linear list. `TransitionCriterion` defined in each `GenerationNode`
| represent the edges in the `GenerationStrategy` graph. `GenerationNodes`
| are more flexible than `GenerationSteps` and new `GenerationStrategies`
| should use nodes. Notably, either, but not both, of `nodes` and `steps`
| must be provided.
| steps: A list of `GenerationStep` describing steps of this strategy.
| name: An optional name for this generation strategy. If not specified,
| strategy's name will be names of its nodes' generators joined with '+'.
|
| Method resolution order:
| GenerationStrategy
| ax.utils.common.base.Base
| builtins.object
|
| Methods defined here:
|
| __init__(self, steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self) -> 'str'
| String representation of this generation strategy.
|
| clone_reset(self) -> 'GenerationStrategy'
| Copy this generation strategy without it's state.
|
| current_generator_run_limit(self) -> 'tuple[int, bool]'
| First check if we can move the generation strategy to the next node, which
| is safe, as the next call to ``gen`` will just pick up from there. Then
| determine how many generator runs this generation strategy can generate right
| now, assuming each one of them becomes its own trial, and whether optimization
| is completed.
|
| Returns: a two-item tuple of:
| - the number of generator runs that can currently be produced, with -1
| meaning unlimited generator runs,
| - whether optimization is completed and the generation strategy cannot
| generate any more generator runs at all.
|
| gen(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int | None' = None, fixed_features: 'ObservationFeatures | None' = None, num_trials: 'int' = 1, arms_per_node: 'dict[str, int] | None' = None) -> 'list[list[GeneratorRun]]'
| Produce GeneratorRuns for multiple trials at once with the possibility of
| using multiple models per trial, getting multiple GeneratorRuns per trial.
|
| Args:
| experiment: ``Experiment``, for which the generation strategy is producing
| a new generator run in the course of ``gen``, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's ``gen``, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the ``experiment``.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
| n: Integer representing how many total arms should be in the generator
| runs produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output generator runs with number of
| arms that can differ from `n`.
| fixed_features: An optional set of ``ObservationFeatures`` that will be
| passed down to the underlying nodes. Note: if provided this will
| override any algorithmically determined fixed features so it is
| important to specify all necessary fixed features.
| num_trials: Number of trials to generate generator runs for in this call.
| If not provided, defaults to 1.
| arms_per_node: An optional map from node name to the number of arms to
| generate from that node. If not provided, will default to the number
| of arms specified in the node's ``InputConstructors`` or n if no
| ``InputConstructors`` are defined on the node. We expect either n or
| arms_per_node to be provided, but not both, and this is an advanced
| argument that should only be used by advanced users.
|
| Returns:
| A list of lists of lists generator runs. Each outer list represents
| a trial being suggested and each inner list represents a generator
| run for that trial.
|
| gen_single_trial(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int' = 1, fixed_features: 'ObservationFeatures | None' = None) -> 'GeneratorRun'
| Produce the next points in the experiment. Additional kwargs passed to
| this method are propagated directly to the underlying node's `gen`, along
| with the `model_gen_kwargs` set on the current generation node.
|
| NOTE: Each generator run returned from this function must become a single
| trial on the experiment to comply with assumptions made in generation
| strategy. Do not split one generator run produced from generation strategy
| into multiple trials (never making a generator run into a trial is allowed).
|
| Args:
| experiment: Experiment, for which the generation strategy is producing
| a new generator run in the course of `gen`, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's `gen`, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the `experiment`.
| n: Integer representing how many arms should be in the generator run
| produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output a generator run with number of
| arms that can differ from `n`.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| adapter
| The adapter from the current node of this strategy. Returns None
| if no adapter has been set yet. This can happen if no generator runs have
| been produced from this GS or if the current node does not utilize
| adapters (the case for ``ExternalGenerationNode``).
|
| current_node
| Current generation node.
|
| current_node_name
| Current generation node name.
|
| current_step
| Current generation step.
|
| current_step_index
| Returns the index of the current generation step. This attribute
| is replaced by node_name in newer GenerationStrategies but surfaced here
| for backward compatibility.
|
| is_node_based
| Whether this strategy consists of GenerationNodes only.
| This is useful for determining initialization properties and
| other logic.
|
| last_generator_run
| Latest generator run produced by this generation strategy.
| Returns None if no generator runs have been produced yet.
|
| name
| Name of this generation strategy.
|
| nodes_dict
| Returns a dictionary mapping node names to nodes.
|
| optimization_complete
| Checks whether all nodes are completed in the generation strategy.
|
| trials_as_df
| Puts information on individual trials into a data frame for easy
| viewing.
|
| THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
| Please use `Experiment.to_df()` instead.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| experiment
| Experiment, currently set on this generation strategy.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| DEFAULT_N = 1
|
| __annotations__ = {'DEFAULT_N': 'int', '_curr': 'GenerationNode', '_ex...
|
| ----------------------------------------------------------------------
| Methods inherited from ax.utils.common.base.Base:
|
| __eq__ = _type_safe_equals(self, other)
| # no type annotation for now; breaks sphinx-autodoc-typehints
| # pyre-fixme[3]: Return type must be annotated.
| # pyre-fixme[2]: Parameter must be annotated.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ax.utils.common.base.Base:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| db_id
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ax.utils.common.base.Base:
|
| __hash__ = None
!!!!! gs: GenerationStrategy(name='SOBOL for 1 step+BOTORCH_MODULAR for 1 step', nodes=[GenerationNode(node_name='SOBOL', generator_specs=[GeneratorSpec(generator_enum=Sobol, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')]), GenerationNode(node_name='BOTORCH_MODULAR', generator_specs=[GeneratorSpec(generator_enum=BoTorch, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')])]) !!!!
Help on GenerationStrategy in module ax.generation_strategy.generation_strategy object:
class GenerationStrategy(ax.utils.common.base.Base)
| GenerationStrategy(steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
|
| GenerationStrategy describes which node should be used to generate new
| points for which trials, enabling and automating use of different nodes
| throughout the optimization process. For instance, it allows to use one
| node for the initialization trials, and another one for all subsequent
| trials. In the general case, this allows to automate use of an arbitrary
| number of nodes to generate an arbitrary numbers of trials.
|
| Args:
| nodes: A list of `GenerationNode`. Each `GenerationNode` in the list
| represents a single node in a `GenerationStrategy` which, when
| composed of `GenerationNodes`, can be conceptualized as a graph instead
| of a linear list. `TransitionCriterion` defined in each `GenerationNode`
| represent the edges in the `GenerationStrategy` graph. `GenerationNodes`
| are more flexible than `GenerationSteps` and new `GenerationStrategies`
| should use nodes. Notably, either, but not both, of `nodes` and `steps`
| must be provided.
| steps: A list of `GenerationStep` describing steps of this strategy.
| name: An optional name for this generation strategy. If not specified,
| strategy's name will be names of its nodes' generators joined with '+'.
|
| Method resolution order:
| GenerationStrategy
| ax.utils.common.base.Base
| builtins.object
|
| Methods defined here:
|
| __init__(self, steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self) -> 'str'
| String representation of this generation strategy.
|
| clone_reset(self) -> 'GenerationStrategy'
| Copy this generation strategy without it's state.
|
| current_generator_run_limit(self) -> 'tuple[int, bool]'
| First check if we can move the generation strategy to the next node, which
| is safe, as the next call to ``gen`` will just pick up from there. Then
| determine how many generator runs this generation strategy can generate right
| now, assuming each one of them becomes its own trial, and whether optimization
| is completed.
|
| Returns: a two-item tuple of:
| - the number of generator runs that can currently be produced, with -1
| meaning unlimited generator runs,
| - whether optimization is completed and the generation strategy cannot
| generate any more generator runs at all.
|
| gen(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int | None' = None, fixed_features: 'ObservationFeatures | None' = None, num_trials: 'int' = 1, arms_per_node: 'dict[str, int] | None' = None) -> 'list[list[GeneratorRun]]'
| Produce GeneratorRuns for multiple trials at once with the possibility of
| using multiple models per trial, getting multiple GeneratorRuns per trial.
|
| Args:
| experiment: ``Experiment``, for which the generation strategy is producing
| a new generator run in the course of ``gen``, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's ``gen``, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the ``experiment``.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
| n: Integer representing how many total arms should be in the generator
| runs produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output generator runs with number of
| arms that can differ from `n`.
| fixed_features: An optional set of ``ObservationFeatures`` that will be
| passed down to the underlying nodes. Note: if provided this will
| override any algorithmically determined fixed features so it is
| important to specify all necessary fixed features.
| num_trials: Number of trials to generate generator runs for in this call.
| If not provided, defaults to 1.
| arms_per_node: An optional map from node name to the number of arms to
| generate from that node. If not provided, will default to the number
| of arms specified in the node's ``InputConstructors`` or n if no
| ``InputConstructors`` are defined on the node. We expect either n or
| arms_per_node to be provided, but not both, and this is an advanced
| argument that should only be used by advanced users.
|
| Returns:
| A list of lists of lists generator runs. Each outer list represents
| a trial being suggested and each inner list represents a generator
| run for that trial.
|
| gen_single_trial(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int' = 1, fixed_features: 'ObservationFeatures | None' = None) -> 'GeneratorRun'
| Produce the next points in the experiment. Additional kwargs passed to
| this method are propagated directly to the underlying node's `gen`, along
| with the `model_gen_kwargs` set on the current generation node.
|
| NOTE: Each generator run returned from this function must become a single
| trial on the experiment to comply with assumptions made in generation
| strategy. Do not split one generator run produced from generation strategy
| into multiple trials (never making a generator run into a trial is allowed).
|
| Args:
| experiment: Experiment, for which the generation strategy is producing
| a new generator run in the course of `gen`, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's `gen`, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the `experiment`.
| n: Integer representing how many arms should be in the generator run
| produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output a generator run with number of
| arms that can differ from `n`.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| adapter
| The adapter from the current node of this strategy. Returns None
| if no adapter has been set yet. This can happen if no generator runs have
| been produced from this GS or if the current node does not utilize
| adapters (the case for ``ExternalGenerationNode``).
|
| current_node
| Current generation node.
|
| current_node_name
| Current generation node name.
|
| current_step
| Current generation step.
|
| current_step_index
| Returns the index of the current generation step. This attribute
| is replaced by node_name in newer GenerationStrategies but surfaced here
| for backward compatibility.
|
| is_node_based
| Whether this strategy consists of GenerationNodes only.
| This is useful for determining initialization properties and
| other logic.
|
| last_generator_run
| Latest generator run produced by this generation strategy.
| Returns None if no generator runs have been produced yet.
|
| name
| Name of this generation strategy.
|
| nodes_dict
| Returns a dictionary mapping node names to nodes.
|
| optimization_complete
| Checks whether all nodes are completed in the generation strategy.
|
| trials_as_df
| Puts information on individual trials into a data frame for easy
| viewing.
|
| THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
| Please use `Experiment.to_df()` instead.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| experiment
| Experiment, currently set on this generation strategy.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| DEFAULT_N = 1
|
| __annotations__ = {'DEFAULT_N': 'int', '_curr': 'GenerationNode', '_ex...
|
| ----------------------------------------------------------------------
| Methods inherited from ax.utils.common.base.Base:
|
| __eq__ = _type_safe_equals(self, other)
| # no type annotation for now; breaks sphinx-autodoc-typehints
| # pyre-fixme[3]: Return type must be annotated.
| # pyre-fixme[2]: Parameter must be annotated.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ax.utils.common.base.Base:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| db_id
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ax.utils.common.base.Base:
|
| __hash__ = None
!!!!! gs: GenerationStrategy(name='SOBOL for 1 step+BOTORCH_MODULAR for 1 step', nodes=[GenerationNode(node_name='SOBOL', generator_specs=[GeneratorSpec(generator_enum=Sobol, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')]), GenerationNode(node_name='BOTORCH_MODULAR', generator_specs=[GeneratorSpec(generator_enum=BoTorch, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')])]) !!!!
Help on GenerationStrategy in module ax.generation_strategy.generation_strategy object:
class GenerationStrategy(ax.utils.common.base.Base)
| GenerationStrategy(steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
|
| GenerationStrategy describes which node should be used to generate new
| points for which trials, enabling and automating use of different nodes
| throughout the optimization process. For instance, it allows to use one
| node for the initialization trials, and another one for all subsequent
| trials. In the general case, this allows to automate use of an arbitrary
| number of nodes to generate an arbitrary numbers of trials.
|
| Args:
| nodes: A list of `GenerationNode`. Each `GenerationNode` in the list
| represents a single node in a `GenerationStrategy` which, when
| composed of `GenerationNodes`, can be conceptualized as a graph instead
| of a linear list. `TransitionCriterion` defined in each `GenerationNode`
| represent the edges in the `GenerationStrategy` graph. `GenerationNodes`
| are more flexible than `GenerationSteps` and new `GenerationStrategies`
| should use nodes. Notably, either, but not both, of `nodes` and `steps`
| must be provided.
| steps: A list of `GenerationStep` describing steps of this strategy.
| name: An optional name for this generation strategy. If not specified,
| strategy's name will be names of its nodes' generators joined with '+'.
|
| Method resolution order:
| GenerationStrategy
| ax.utils.common.base.Base
| builtins.object
|
| Methods defined here:
|
| __init__(self, steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self) -> 'str'
| String representation of this generation strategy.
|
| clone_reset(self) -> 'GenerationStrategy'
| Copy this generation strategy without it's state.
|
| current_generator_run_limit(self) -> 'tuple[int, bool]'
| First check if we can move the generation strategy to the next node, which
| is safe, as the next call to ``gen`` will just pick up from there. Then
| determine how many generator runs this generation strategy can generate right
| now, assuming each one of them becomes its own trial, and whether optimization
| is completed.
|
| Returns: a two-item tuple of:
| - the number of generator runs that can currently be produced, with -1
| meaning unlimited generator runs,
| - whether optimization is completed and the generation strategy cannot
| generate any more generator runs at all.
|
| gen(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int | None' = None, fixed_features: 'ObservationFeatures | None' = None, num_trials: 'int' = 1, arms_per_node: 'dict[str, int] | None' = None) -> 'list[list[GeneratorRun]]'
| Produce GeneratorRuns for multiple trials at once with the possibility of
| using multiple models per trial, getting multiple GeneratorRuns per trial.
|
| Args:
| experiment: ``Experiment``, for which the generation strategy is producing
| a new generator run in the course of ``gen``, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's ``gen``, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the ``experiment``.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
| n: Integer representing how many total arms should be in the generator
| runs produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output generator runs with number of
| arms that can differ from `n`.
| fixed_features: An optional set of ``ObservationFeatures`` that will be
| passed down to the underlying nodes. Note: if provided this will
| override any algorithmically determined fixed features so it is
| important to specify all necessary fixed features.
| num_trials: Number of trials to generate generator runs for in this call.
| If not provided, defaults to 1.
| arms_per_node: An optional map from node name to the number of arms to
| generate from that node. If not provided, will default to the number
| of arms specified in the node's ``InputConstructors`` or n if no
| ``InputConstructors`` are defined on the node. We expect either n or
| arms_per_node to be provided, but not both, and this is an advanced
| argument that should only be used by advanced users.
|
| Returns:
| A list of lists of lists generator runs. Each outer list represents
| a trial being suggested and each inner list represents a generator
| run for that trial.
|
| gen_single_trial(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int' = 1, fixed_features: 'ObservationFeatures | None' = None) -> 'GeneratorRun'
| Produce the next points in the experiment. Additional kwargs passed to
| this method are propagated directly to the underlying node's `gen`, along
| with the `model_gen_kwargs` set on the current generation node.
|
| NOTE: Each generator run returned from this function must become a single
| trial on the experiment to comply with assumptions made in generation
| strategy. Do not split one generator run produced from generation strategy
| into multiple trials (never making a generator run into a trial is allowed).
|
| Args:
| experiment: Experiment, for which the generation strategy is producing
| a new generator run in the course of `gen`, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's `gen`, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the `experiment`.
| n: Integer representing how many arms should be in the generator run
| produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output a generator run with number of
| arms that can differ from `n`.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| adapter
| The adapter from the current node of this strategy. Returns None
| if no adapter has been set yet. This can happen if no generator runs have
| been produced from this GS or if the current node does not utilize
| adapters (the case for ``ExternalGenerationNode``).
|
| current_node
| Current generation node.
|
| current_node_name
| Current generation node name.
|
| current_step
| Current generation step.
|
| current_step_index
| Returns the index of the current generation step. This attribute
| is replaced by node_name in newer GenerationStrategies but surfaced here
| for backward compatibility.
|
| is_node_based
| Whether this strategy consists of GenerationNodes only.
| This is useful for determining initialization properties and
| other logic.
|
| last_generator_run
| Latest generator run produced by this generation strategy.
| Returns None if no generator runs have been produced yet.
|
| name
| Name of this generation strategy.
|
| nodes_dict
| Returns a dictionary mapping node names to nodes.
|
| optimization_complete
| Checks whether all nodes are completed in the generation strategy.
|
| trials_as_df
| Puts information on individual trials into a data frame for easy
| viewing.
|
| THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
| Please use `Experiment.to_df()` instead.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| experiment
| Experiment, currently set on this generation strategy.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| DEFAULT_N = 1
|
| __annotations__ = {'DEFAULT_N': 'int', '_curr': 'GenerationNode', '_ex...
|
| ----------------------------------------------------------------------
| Methods inherited from ax.utils.common.base.Base:
|
| __eq__ = _type_safe_equals(self, other)
| # no type annotation for now; breaks sphinx-autodoc-typehints
| # pyre-fixme[3]: Return type must be annotated.
| # pyre-fixme[2]: Parameter must be annotated.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ax.utils.common.base.Base:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| db_id
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ax.utils.common.base.Base:
|
| __hash__ = None
!!!!! gs: GenerationStrategy(name='SOBOL for 1 step+BOTORCH_MODULAR for 1 step', nodes=[GenerationNode(node_name='SOBOL', generator_specs=[GeneratorSpec(generator_enum=Sobol, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')]), GenerationNode(node_name='BOTORCH_MODULAR', generator_specs=[GeneratorSpec(generator_enum=BoTorch, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')])]) !!!!
SOBOL, best RESULT: -141818.478726083, new result: RESULT: -201752.736581 : 100%|██████████| 2/2 [00:28 'None'
|
| GenerationStrategy describes which node should be used to generate new
| points for which trials, enabling and automating use of different nodes
| throughout the optimization process. For instance, it allows to use one
| node for the initialization trials, and another one for all subsequent
| trials. In the general case, this allows to automate use of an arbitrary
| number of nodes to generate an arbitrary numbers of trials.
|
| Args:
| nodes: A list of `GenerationNode`. Each `GenerationNode` in the list
| represents a single node in a `GenerationStrategy` which, when
| composed of `GenerationNodes`, can be conceptualized as a graph instead
| of a linear list. `TransitionCriterion` defined in each `GenerationNode`
| represent the edges in the `GenerationStrategy` graph. `GenerationNodes`
| are more flexible than `GenerationSteps` and new `GenerationStrategies`
| should use nodes. Notably, either, but not both, of `nodes` and `steps`
| must be provided.
| steps: A list of `GenerationStep` describing steps of this strategy.
| name: An optional name for this generation strategy. If not specified,
| strategy's name will be names of its nodes' generators joined with '+'.
|
| Method resolution order:
| GenerationStrategy
| ax.utils.common.base.Base
| builtins.object
|
| Methods defined here:
|
| __init__(self, steps: 'list[GenerationStep] | None' = None, name: 'str | None' = None, nodes: 'list[GenerationNode] | None' = None) -> 'None'
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self) -> 'str'
| String representation of this generation strategy.
|
| clone_reset(self) -> 'GenerationStrategy'
| Copy this generation strategy without it's state.
|
| current_generator_run_limit(self) -> 'tuple[int, bool]'
| First check if we can move the generation strategy to the next node, which
| is safe, as the next call to ``gen`` will just pick up from there. Then
| determine how many generator runs this generation strategy can generate right
| now, assuming each one of them becomes its own trial, and whether optimization
| is completed.
|
| Returns: a two-item tuple of:
| - the number of generator runs that can currently be produced, with -1
| meaning unlimited generator runs,
| - whether optimization is completed and the generation strategy cannot
| generate any more generator runs at all.
|
| gen(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int | None' = None, fixed_features: 'ObservationFeatures | None' = None, num_trials: 'int' = 1, arms_per_node: 'dict[str, int] | None' = None) -> 'list[list[GeneratorRun]]'
| Produce GeneratorRuns for multiple trials at once with the possibility of
| using multiple models per trial, getting multiple GeneratorRuns per trial.
|
| Args:
| experiment: ``Experiment``, for which the generation strategy is producing
| a new generator run in the course of ``gen``, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's ``gen``, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the ``experiment``.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
| n: Integer representing how many total arms should be in the generator
| runs produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output generator runs with number of
| arms that can differ from `n`.
| fixed_features: An optional set of ``ObservationFeatures`` that will be
| passed down to the underlying nodes. Note: if provided this will
| override any algorithmically determined fixed features so it is
| important to specify all necessary fixed features.
| num_trials: Number of trials to generate generator runs for in this call.
| If not provided, defaults to 1.
| arms_per_node: An optional map from node name to the number of arms to
| generate from that node. If not provided, will default to the number
| of arms specified in the node's ``InputConstructors`` or n if no
| ``InputConstructors`` are defined on the node. We expect either n or
| arms_per_node to be provided, but not both, and this is an advanced
| argument that should only be used by advanced users.
|
| Returns:
| A list of lists of lists generator runs. Each outer list represents
| a trial being suggested and each inner list represents a generator
| run for that trial.
|
| gen_single_trial(self, experiment: 'Experiment', data: 'Data | None' = None, pending_observations: 'dict[str, list[ObservationFeatures]] | None' = None, n: 'int' = 1, fixed_features: 'ObservationFeatures | None' = None) -> 'GeneratorRun'
| Produce the next points in the experiment. Additional kwargs passed to
| this method are propagated directly to the underlying node's `gen`, along
| with the `model_gen_kwargs` set on the current generation node.
|
| NOTE: Each generator run returned from this function must become a single
| trial on the experiment to comply with assumptions made in generation
| strategy. Do not split one generator run produced from generation strategy
| into multiple trials (never making a generator run into a trial is allowed).
|
| Args:
| experiment: Experiment, for which the generation strategy is producing
| a new generator run in the course of `gen`, and to which that
| generator run will be added as trial(s). Information stored on the
| experiment (e.g., trial statuses) is used to determine which node
| will be used to produce the generator run returned from this method.
| data: Optional data to be passed to the underlying node's `gen`, which
| is called within this method and actually produces the resulting
| generator run. By default, data is all data on the `experiment`.
| n: Integer representing how many arms should be in the generator run
| produced by this method. NOTE: Some underlying nodes may ignore
| the `n` and produce a node-determined number of arms. In that
| case this method will also output a generator run with number of
| arms that can differ from `n`.
| pending_observations: A map from metric name to pending
| observations for that metric, used by some nodes to avoid
| resuggesting points that are currently being evaluated.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| adapter
| The adapter from the current node of this strategy. Returns None
| if no adapter has been set yet. This can happen if no generator runs have
| been produced from this GS or if the current node does not utilize
| adapters (the case for ``ExternalGenerationNode``).
|
| current_node
| Current generation node.
|
| current_node_name
| Current generation node name.
|
| current_step
| Current generation step.
|
| current_step_index
| Returns the index of the current generation step. This attribute
| is replaced by node_name in newer GenerationStrategies but surfaced here
| for backward compatibility.
|
| is_node_based
| Whether this strategy consists of GenerationNodes only.
| This is useful for determining initialization properties and
| other logic.
|
| last_generator_run
| Latest generator run produced by this generation strategy.
| Returns None if no generator runs have been produced yet.
|
| name
| Name of this generation strategy.
|
| nodes_dict
| Returns a dictionary mapping node names to nodes.
|
| optimization_complete
| Checks whether all nodes are completed in the generation strategy.
|
| trials_as_df
| Puts information on individual trials into a data frame for easy
| viewing.
|
| THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
| Please use `Experiment.to_df()` instead.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| experiment
| Experiment, currently set on this generation strategy.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| DEFAULT_N = 1
|
| __annotations__ = {'DEFAULT_N': 'int', '_curr': 'GenerationNode', '_ex...
|
| ----------------------------------------------------------------------
| Methods inherited from ax.utils.common.base.Base:
|
| __eq__ = _type_safe_equals(self, other)
| # no type annotation for now; breaks sphinx-autodoc-typehints
| # pyre-fixme[3]: Return type must be annotated.
| # pyre-fixme[2]: Parameter must be annotated.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ax.utils.common.base.Base:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| db_id
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from ax.utils.common.base.Base:
|
| __hash__ = None
!!!!! gs: GenerationStrategy(name='SOBOL for 1 step+BOTORCH_MODULAR for 1 step', nodes=[GenerationNode(node_name='SOBOL', generator_specs=[GeneratorSpec(generator_enum=Sobol, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')]), GenerationNode(node_name='BOTORCH_MODULAR', generator_specs=[GeneratorSpec(generator_enum=BoTorch, model_key_override=None)],
transition_criteria=[MaxTrials(transition_to='BOTORCH_MODULAR')])]) !!!!
SOBOL, best RESULT: -201752.736580684, finishing jobs, finished 1 job : 100%|██████████| 2/2 [00:30<00:00, 15.48s/it]
Best RESULT, min (total: 2)
┏━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┓
┃OO_Info_int_param┃OO_Info_int_param_two┃OO_Info_float_param┃OO_Info_choice_param┃int_param┃float_param ┃int_param_two┃choice_param┃RESULT ┃
┡━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━┩
│9 │-99 │-92.09903016028761 │4 │9 │-92.09903016028763│-99 │4 │-201752.736580684│
└───────────────────┴───────────────────────┴─────────────────────┴──────────────────────┴───────────┴────────────────────┴───────────────┴──────────────┴───────────────────┘
Runtime Infos
┏━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃Number of evaluations┃Min time ┃Max time ┃Average time┃Median time┃
┡━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
│ 2 │ 6.00 sec │ 7.00 sec │ 6.50 sec │ 6.50 sec │
└───────────────────────┴───────────┴───────────┴──────────────┴─────────────┘
Model generation times
┏━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━┳━━━━━━━━━━━━━━┓
┃Iteration┃Seconds┃Jobs┃Time per job┃
┡━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━╇━━━━━━━━━━━━━━┩
│ 1 │ 0.054 │ 1 │ 0.054 │
│ 2 │ 0.467 │ 1 │ 0.467 │
├───────────┼─────────┼──────┼──────────────┤
│ Average │ 0.261 │ │ │
│ Median │ 0.261 │ │ │
│ Total │ 0.521 │ │ │
│ Max │ 0.467 │ │ │
│ Min │ 0.054 │ │ │
└───────────┴─────────┴──────┴──────────────┘
Job submission durations
┏━━━━━━━━━┳━━━━━━━━━┳━━━━━━┳━━━━━━━━━━━━━━┓
┃ Batch┃Seconds┃Jobs┃Time per job┃
┡━━━━━━━━━╇━━━━━━━━━╇━━━━━━╇━━━━━━━━━━━━━━┩
│ 1 │ 0.147 │ 1 │ 0.147 │
│ 2 │ 0.103 │ 1 │ 0.103 │
├─────────┼─────────┼──────┼──────────────┤
│ Average │ 0.125 │ │ │
│ Median │ 0.125 │ │ │
│ Total │ 0.251 │ │ │
│ Max │ 0.147 │ │ │
│ Min │ 0.103 │ │ │
└─────────┴─────────┴──────┴──────────────┘
2025-11-01 12:38:24 (a36d9e99-9060-4b3f-903f-f4dbf3e672c7): SOBOL, Started OmniOpt2 run...
2025-11-01 12:38:24 (a36d9e99-9060-4b3f-903f-f4dbf3e672c7): SOBOL, getting new HP set (no sbatch)
2025-11-01 12:38:24 (a36d9e99-9060-4b3f-903f-f4dbf3e672c7): SOBOL, requested 1 jobs, got 1, 0.05 s/job
2025-11-01 12:38:24 (a36d9e99-9060-4b3f-903f-f4dbf3e672c7): SOBOL, eval #1/1 start
2025-11-01 12:38:24 (a36d9e99-9060-4b3f-903f-f4dbf3e672c7): SOBOL, starting new job
2025-11-01 12:38:24 (a36d9e99-9060-4b3f-903f-f4dbf3e672c7): SOBOL, started new job
2025-11-01 12:38:35 (a36d9e99-9060-4b3f-903f-f4dbf3e672c7): SOBOL, new result: RESULT: -141818.478726
2025-11-01 12:38:42 (a36d9e99-9060-4b3f-903f-f4dbf3e672c7): SOBOL, best RESULT: -141818.478726083, finishing jobs, finished 1 job
2025-11-01 12:38:42 (a36d9e99-9060-4b3f-903f-f4dbf3e672c7): SOBOL, best RESULT: -141818.478726083, getting new HP set (no sbatch)
2025-11-01 12:38:42 (a36d9e99-9060-4b3f-903f-f4dbf3e672c7): SOBOL, best RESULT: -141818.478726083, requested 1 jobs, got 1, 0.47 s/job
2025-11-01 12:38:42 (a36d9e99-9060-4b3f-903f-f4dbf3e672c7): SOBOL, best RESULT: -141818.478726083, eval #1/1 start
2025-11-01 12:38:42 (a36d9e99-9060-4b3f-903f-f4dbf3e672c7): SOBOL, best RESULT: -141818.478726083, starting new job
2025-11-01 12:38:42 (a36d9e99-9060-4b3f-903f-f4dbf3e672c7): SOBOL, best RESULT: -141818.478726083, started new job
2025-11-01 12:38:52 (a36d9e99-9060-4b3f-903f-f4dbf3e672c7): SOBOL, best RESULT: -141818.478726083, new result: RESULT: -201752.736581
2025-11-01 12:38:55 (a36d9e99-9060-4b3f-903f-f4dbf3e672c7): SOBOL, best RESULT: -201752.736580684, finishing jobs, finished 1 job
Job submission durations
┏━━━━━━━━━┳━━━━━━━━━┳━━━━━━┳━━━━━━━━━━━━━━┓
┃ Batch ┃ Seconds ┃ Jobs ┃ Time per job ┃
┡━━━━━━━━━╇━━━━━━━━━╇━━━━━━╇━━━━━━━━━━━━━━┩
│ 1 │ 0.147 │ 1 │ 0.147 │
│ 2 │ 0.103 │ 1 │ 0.103 │
├─────────┼─────────┼──────┼──────────────┤
│ Average │ 0.125 │ │ │
│ Median │ 0.125 │ │ │
│ Total │ 0.251 │ │ │
│ Max │ 0.147 │ │ │
│ Min │ 0.103 │ │ │
└─────────┴─────────┴──────┴──────────────┘
Model generation times
┏━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━┳━━━━━━━━━━━━━━┓
┃ Iteration ┃ Seconds ┃ Jobs ┃ Time per job ┃
┡━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━╇━━━━━━━━━━━━━━┩
│ 1 │ 0.054 │ 1 │ 0.054 │
│ 2 │ 0.467 │ 1 │ 0.467 │
├───────────┼─────────┼──────┼──────────────┤
│ Average │ 0.261 │ │ │
│ Median │ 0.261 │ │ │
│ Total │ 0.521 │ │ │
│ Max │ 0.467 │ │ │
│ Min │ 0.054 │ │ │
└───────────┴─────────┴──────┴──────────────┘