class_docstr: Base class for samplers.
  
  Optuna combines two types of sampling strategies, which are called *relative sampling* and
  *independent sampling*.
  
  *The relative sampling* determines values of multiple parameters simultaneously so that
  sampling algorithms can use relationship between parameters (e.g., correlation).
  Target parameters of the relative sampling are described in a relative search space, which
  is determined by :func:`~optuna.samplers.BaseSampler.infer_relative_search_space`.
  
  *The independent sampling* determines a value of a single parameter without considering any
  relationship between parameters. Target parameters of the independent sampling are the
  parameters not described in the relative search space.
  
  More specifically, parameters are sampled by the following procedure.
  At the beginning of a trial, :meth:`~optuna.samplers.BaseSampler.infer_relative_search_space`
  is called to determine the relative search space for the trial.
  During the execution of the objective function,
  :meth:`~optuna.samplers.BaseSampler.sample_relative` is called only once
  when sampling the parameters belonging to the relative search space for the first time.
  :meth:`~optuna.samplers.BaseSampler.sample_independent` is used to sample
  parameters that don't belong to the relative search space.
  
  The following figure depicts the lifetime of a trial and how the above three methods are
  called in the trial.
  
  .. image:: ../../../../image/sampling-sequence.png
  
  |
docstr: Sample parameters in a given search space.
  
  This method is called once at the beginning of each trial, i.e., right before the
  evaluation of the objective function. This method is suitable for sampling algorithms
  that use relationship between parameters such as Gaussian Process and CMA-ES.
  
  .. note::
          The failed trials are ignored by any build-in samplers when they sample new
          parameters. Thus, failed trials are regarded as deleted in the samplers'
          perspective.
  
  Args:
      study:
          Target study object.
      trial:
          Target trial object.
          Take a copy before modifying this object.
      search_space:
          The search space returned by
          :func:`~optuna.samplers.BaseSampler.infer_relative_search_space`.
  
  Returns:
      A dictionary containing the parameter names and the values.
docstr_tok: ["Sample","parameters","in","a","given","search","space",".","This","method","is","called","once","at","the","beginning","of","each","trial",",","i.e.",",","right","before","the","evaluation","of","the","objective","function",".","This","method","is","suitable","for","sampling","algorithms","that","use","relationship","between","parameters","such","as","Gaussian","Process","and","CMA-ES",".","..","note",":",":","The","failed","trials","are","ignored","by","any","build-in","samplers","when","they","sample","new","parameters",".","Thus",",","failed","trials","are","regarded","as","deleted","in","the","samplers'","perspective",".","Args",":","study",":","Target","study","object",".","trial",":","Target","trial","object",".","Take","a","copy","before","modifying","this","object",".","search_space",":","The","search","space","returned","by",":","func",":","`","~optuna.samplers.BaseSampler.infer_relative_search_space","`",".","Returns",":","A","dictionary","containing","the","parameter","names","and","the","values","."]
code: def sample_relative(
      self,
      study: Study,
      trial: FrozenTrial,
      search_space: Dict[str, BaseDistribution],
  ) -> Dict[str, Any]:
      """Sample parameters in a given search space.
  
      This method is called once at the beginning of each trial, i.e., right before the
      evaluation of the objective function. This method is suitable for sampling algorithms
      that use relationship between parameters such as Gaussian Process and CMA-ES.
  
      .. note::
              The failed trials are ignored by any build-in samplers when they sample new
              parameters. Thus, failed trials are regarded as deleted in the samplers'
              perspective.
  
      Args:
          study:
              Target study object.
          trial:
              Target trial object.
              Take a copy before modifying this object.
          search_space:
              The search space returned by
              :func:`~optuna.samplers.BaseSampler.infer_relative_search_space`.
  
      Returns:
          A dictionary containing the parameter names and the values.
  
      """
  
      raise NotImplementedError
  
imports: import abc
  from typing import Any
  from typing import Callable
  from typing import Dict
  from typing import Optional
  from typing import Sequence
  import warnings
  import numpy
  from optuna.distributions import BaseDistribution
  from optuna.study import Study
  from optuna.trial import FrozenTrial
  from optuna.trial import TrialState
label_desc: Use image node_id 3 for calling the BaseSampler obj's underlying member method code with example usage: obj.sample_relative(study, trial, search_space) without return types