class_docstr: Wrapper around the `Ax platform <https://ax.dev/>`_ for multi-objectives
  optimization and constraints.
  
  Parameters
  ----------
  space: `orion.algo.space.Space`
      Optimisation space with priors for each dimension.
  seed: None, int or sequence of int, optional
      random seed for reproducibility. Works only for Sobol quasi-random
      generator and for BoTorch-powered models. For the latter models, the
      trials generated from the same optimization setup with the same seed,
      will be mostly similar, but the exact parameter values may still vary
      and trials latter in the optimizations will diverge more and more. This
      is because a degree of randomness is essential for high performance of
      the Bayesian optimization models and is not controlled by the seed.
  
      .. note:: In multi-threaded environments, the random seed is
         thread-safe, but does not actually guarantee reproducibility. Whether
         the outcomes will be exactly the same for two same operations that
         use the random seed, depends on whether the threads modify the random
         state in the same order across the two operations.  Default: ``None``
  n_initial_trials: int, optional
      Specific number of initialization trials.
      Initialization trials are generated quasi-randomly using Sobol.
  extra_objectives: sequence of str, optional
      List of metrics' name which are also objectives to minimize.
      threshold: The bound in the objective's threshold constraint.
  
      .. note:: Orion expects the `extra_objectives` results to be stored in
         `orion.core.worker.Trial.statistics`
  constraints: sequence of str, optional
      Dict of list of string representation of metrics constraints of form
      ["metric_name >= bound"], like ["m1 <= 3"]
  
      .. note:: Orion expects the `constraints` results to be stored in
         `orion.core.worker.Trial.constraints`
      .. note:: See https://ax.dev/docs/core.html#optimization-config for more
         details about how Ax expects its outcome constraints
class_docstr_tok: ["Wrapper","around","the","`","Ax","platform","<","https",":","\/\/ax.dev\/",">","`","_","for","multi-objectives","optimization","and","constraints",".","Parameters","--","--","--","--","--","space",":","`","orion.algo.space.Space","`","Optimisation","space","with","priors","for","each","dimension",".","seed",":","None",",","int","or","sequence","of","int",",","optional","random","seed","for","reproducibility",".","Works","only","for","Sobol","quasi-random","generator","and","for","BoTorch-powered","models",".","For","the","latter","models",",","the","trials","generated","from","the","same","optimization","setup","with","the","same","seed",",","will","be","mostly","similar",",","but","the","exact","parameter","values","may","still","vary","and","trials","latter","in","the","optimizations","will","diverge","more","and","more",".","This","is","because","a","degree","of","randomness","is","essential","for","high","performance","of","the","Bayesian","optimization","models","and","is","not","controlled","by","the","seed",".","..","note",":",":","In","multi-threaded","environments",",","the","random","seed","is","thread-safe",",","but","does","not","actually","guarantee","reproducibility",".","Whether","the","outcomes","will","be","exactly","the","same","for","two","same","operations","that","use","the","random","seed",",","depends","on","whether","the","threads","modify","the","random","state","in","the","same","order","across","the","two","operations",".","Default",":","``","None","``","n_initial_trials",":","int",",","optional","Specific","number","of","initialization","trials",".","Initialization","trials","are","generated","quasi-randomly","using","Sobol",".","extra_objectives",":","sequence","of","str",",","optional","List","of","metrics","'","name","which","are","also","objectives","to","minimize",".","threshold",":","The","bound","in","the","objective","'s","threshold","constraint",".","..","note",":",":","Orion","expects","the","`","extra_objectives","`","results","to","be","stored","in","`","orion.core.worker.Trial.statistics","`","constraints",":","sequence","of","str",",","optional","Dict","of","list","of","string","representation","of","metrics","constraints","of","form","[","``","metric_name",">","=","bound","''","]",",","like","[","``","m1","<","=","3","''","]","..","note",":",":","Orion","expects","the","`","constraints","`","results","to","be","stored","in","`","orion.core.worker.Trial.constraints","`","..","note",":",":","See","https",":","\/\/ax.dev\/docs\/core.html","#","optimization-config","for","more","details","about","how","Ax","expects","its","outcome","constraints"]
docstr: Suggest a number of new sets of parameters.
  
  Parameters
  ----------
  num: int
      Number of trials to suggest. The algorithm may return less than the number of trials
      requested.
  
  Returns
  -------
  list of trials
      A list of trials representing values suggested by the algorithm. The algorithm may opt
      out if it cannot make a good suggestion at the moment (it may be waiting for other
      trials to complete), in which case it will return None.
  
  
  Notes
  -----
  New parameters must be compliant with the problem's domain `orion.algo.space.Space`.
docstr_tok: ["Suggest","a","number","of","new","sets","of","parameters",".","Parameters","--","--","--","--","--","num",":","int","Number","of","trials","to","suggest",".","The","algorithm","may","return","less","than","the","number","of","trials","requested",".","Returns","--","--","--","-","list","of","trials","A","list","of","trials","representing","values","suggested","by","the","algorithm",".","The","algorithm","may","opt","out","if","it","can","not","make","a","good","suggestion","at","the","moment","(","it","may","be","waiting","for","other","trials","to","complete",")",",","in","which","case","it","will","return","None",".","Notes","--","--","-","New","parameters","must","be","compliant","with","the","problem","'s","domain","`","orion.algo.space.Space","`","."]
code: def suggest(self, num):
      """Suggest a number of new sets of parameters.
  
      Parameters
      ----------
      num: int
          Number of trials to suggest. The algorithm may return less than the number of trials
          requested.
  
      Returns
      -------
      list of trials
          A list of trials representing values suggested by the algorithm. The algorithm may opt
          out if it cannot make a good suggestion at the moment (it may be waiting for other
          trials to complete), in which case it will return None.
  
  
      Notes
      -----
      New parameters must be compliant with the problem's domain `orion.algo.space.Space`.
  
      """
      trials = []
      with self.get_client() as client:
          _trials, _ = client.get_next_trials(num)
          for trial_index, parameters in _trials.items():
              parameters = AxOptimizer.reverse_params(
                  parameters, self.space
              )
  
              # Ax does not support Fidelity dimension type so fake it with
              # its max
              if self.fidelity_index is not None:
                  # Convert 0-dim arrays into python numbers so their type can
                  # be validated by Ax
                  fidelity_dim = self.space[self.fidelity_index]
                  while isinstance(fidelity_dim, TransformedDimension):
                      fidelity_dim = fidelity_dim.original_dimension
                  assert isinstance(fidelity_dim, Fidelity)
                  parameters[self.fidelity_index] = float(
                      fidelity_dim.high
                  )
  
              new_trial = format_trials.dict_to_trial(
                  parameters, self.space
              )
  
              if not self.has_suggested(new_trial):
                  self.register(new_trial)
                  trials.append(new_trial)
                  self._trials_map[
                      self.get_id(new_trial)
                  ] = trial_index  # tmp
  
      return trials
  
imports: import contextlib
  import copy
  from typing import List, Optional
  from orion.algo.base import BaseAlgorithm
  from orion.algo.space import Fidelity, Space
  from orion.core.utils import format_trials
  from orion.core.utils.flatten import flatten
  from orion.core.utils.module_import import ImportOptional
  from orion.core.worker.transformer import TransformedDimension
label_desc: Use image node_id 6 for calling the AxOptimizer obj's underlying member method code with example usage: obj.suggest(num) and returns: trials