
    -jii                        S SK Jr  S SKJr  S SKrS SKrS SKrS SKJr  S SKJ	r	  S SKJ
r
  S SKJr  S SKrS SKrS SKJr  S S	KJr  S S
KJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJ r   S SK!J"r"  S SK#J$r$  S SK%J&r&  S SK'J(r(  S SK'J)r)  \
(       a+  S SK*r*\\*RV                  \*RX                  \*RZ                  4   r.O\" S5      r*\R^                  " \05      r1Sr2Sr3 " S S\5      r4      SS jr5g)    )annotations)SequenceN)Any)cast)TYPE_CHECKING)Union)_deprecated)logging)warn_experimental_argument)_LazyImport)_SearchSpaceTransform)optuna_warn)BaseDistribution)FloatDistribution)IntDistribution)BaseSampler)&_INDEPENDENT_SAMPLING_WARNING_TEMPLATE)LazyRandomState)IntersectionSearchSpace)StudyDirection)FrozenTrial)
TrialStatecmaesg|=i  c            
         \ rS rSrSr      SSSSSSSSSS.                             SS jjjrSS jr      SS	 jr        SS
 jr\	SS j5       r
\	SS j5       rSS jrSS jr    S S jr      S!S jr          S"S jrS#S jrS$S jr      S%S jrS&S jr          S'S jrSrg)(CmaEsSampler/   u$  A sampler using `cmaes <https://github.com/CyberAgentAILab/cmaes>`__ as the backend.

Example:

    Optimize a simple quadratic function by using :class:`~optuna.samplers.CmaEsSampler`.

    .. code-block:: console

       $ pip install cmaes

    .. testcode::

        import optuna


        def objective(trial):
            x = trial.suggest_float("x", -1, 1)
            y = trial.suggest_int("y", -1, 1)
            return x**2 + y


        sampler = optuna.samplers.CmaEsSampler()
        study = optuna.create_study(sampler=sampler)
        study.optimize(objective, n_trials=20)

Please note that this sampler does not support CategoricalDistribution.
However, :class:`~optuna.distributions.FloatDistribution` with ``step``,
(:func:`~optuna.trial.Trial.suggest_float`) and
:class:`~optuna.distributions.IntDistribution` (:func:`~optuna.trial.Trial.suggest_int`)
are supported.

If your search space contains categorical parameters, I recommend you
to use :class:`~optuna.samplers.TPESampler` instead.
Furthermore, there is room for performance improvements in parallel
optimization settings. This sampler cannot use some trials for updating
the parameters of multivariate normal distribution.

For further information about CMA-ES algorithm, please refer to the following papers:

- `N. Hansen, The CMA Evolution Strategy: A Tutorial. arXiv:1604.00772, 2016.
  <https://arxiv.org/abs/1604.00772>`__
- `A. Auger and N. Hansen. A restart CMA evolution strategy with increasing population
  size. In Proceedings of the IEEE Congress on Evolutionary Computation (CEC 2005),
  pages 1769–1776. IEEE Press, 2005. <https://doi.org/10.1109/CEC.2005.1554902>`__
- `N. Hansen. Benchmarking a BI-Population CMA-ES on the BBOB-2009 Function Testbed.
  GECCO Workshop, 2009. <https://doi.org/10.1145/1570256.1570333>`__
- `Raymond Ros, Nikolaus Hansen. A Simple Modification in CMA-ES Achieving Linear Time and
  Space Complexity. 10th International Conference on Parallel Problem Solving From Nature,
  Sep 2008, Dortmund, Germany. inria-00287367. <https://doi.org/10.1007/978-3-540-87700-4_30>`__
- `Masahiro Nomura, Shuhei Watanabe, Youhei Akimoto, Yoshihiko Ozaki, Masaki Onishi.
  Warm Starting CMA-ES for Hyperparameter Optimization, AAAI. 2021.
  <https://doi.org/10.1609/aaai.v35i10.17109>`__
- `R. Hamano, S. Saito, M. Nomura, S. Shirakawa. CMA-ES with Margin: Lower-Bounding Marginal
  Probability for Mixed-Integer Black-Box Optimization, GECCO. 2022.
  <https://doi.org/10.1145/3512290.3528827>`__
- `M. Nomura, Y. Akimoto, I. Ono. CMA-ES with Learning Rate Adaptation: Can CMA-ES with
  Default Population Size Solve Multimodal and Noisy Problems?, GECCO. 2023.
  <https://doi.org/10.1145/3583131.3590358>`__

.. seealso::
    You can also use `optuna_integration.PyCmaSampler <https://optuna-integration.readthedocs.io/en/stable/reference/generated/optuna_integration.PyCmaSampler.html#optuna_integration.PyCmaSampler>`__ which is a sampler using cma
    library as the backend.

Args:

    x0:
        A dictionary of an initial parameter values for CMA-ES. By default, the mean of ``low``
        and ``high`` for each distribution is used. Note that ``x0`` is sampled uniformly
        within the search space domain for each restart if you specify ``restart_strategy``
        argument.

    sigma0:
        Initial standard deviation of CMA-ES. By default, ``sigma0`` is set to
        ``min_range / 6``, where ``min_range`` denotes the minimum range of the distributions
        in the search space.

    seed:
        A random seed for CMA-ES.

    n_startup_trials:
        The independent sampling is used instead of the CMA-ES algorithm until the given number
        of trials finish in the same study.

    independent_sampler:
        A :class:`~optuna.samplers.BaseSampler` instance that is used for independent
        sampling. The parameters not contained in the relative search space are sampled
        by this sampler.
        The search space for :class:`~optuna.samplers.CmaEsSampler` is determined by
        :func:`~optuna.search_space.intersection_search_space()`.

        If :obj:`None` is specified, :class:`~optuna.samplers.RandomSampler` is used
        as the default.

        .. seealso::
            :class:`optuna.samplers` module provides built-in independent samplers
            such as :class:`~optuna.samplers.RandomSampler` and
            :class:`~optuna.samplers.TPESampler`.

    warn_independent_sampling:
        If this is :obj:`True`, a warning message is emitted when
        the value of a parameter is sampled by using an independent sampler.

        Note that the parameters of the first trial in a study are always sampled
        via an independent sampler, so no warning messages are emitted in this case.

    restart_strategy:
        Strategy for restarting CMA-ES optimization when converges to a local minimum.
        If :obj:`None` is given, CMA-ES will not restart (default).
        If 'ipop' is given, CMA-ES will restart with increasing population size.
        if 'bipop' is given, CMA-ES will restart with the population size
        increased or decreased.
        Please see also ``inc_popsize`` parameter.

        .. warning::
            Deprecated in v4.4.0. ``restart_strategy`` argument will be removed in the future.
            The removal of this feature is currently scheduled for v6.0.0,
            but this schedule is subject to change.
            From v4.4.0 onward, ``restart_strategy`` automatically falls back to ``None``, and
            ``restart_strategy`` will be supported in OptunaHub.
            See https://github.com/optuna/optuna/releases/tag/v4.4.0.

    popsize:
        A population size of CMA-ES.

    inc_popsize:
        Multiplier for increasing population size before each restart.
        This argument will be used when ``restart_strategy = 'ipop'``
        or ``restart_strategy = 'bipop'`` is specified.

        .. warning::
            Deprecated in v4.4.0. ``inc_popsize`` argument will be removed in the future.
            The removal of this feature is currently scheduled for v6.0.0,
            but this schedule is subject to change.
            From v4.4.0 onward, ``inc_popsize`` is no longer utilized within Optuna, and
            ``inc_popsize`` will be supported in OptunaHub.
            See https://github.com/optuna/optuna/releases/tag/v4.4.0.

    consider_pruned_trials:
        If this is :obj:`True`, the PRUNED trials are considered for sampling.

        .. note::
            Added in v2.0.0 as an experimental feature. The interface may change in newer
            versions without prior notice. See
            https://github.com/optuna/optuna/releases/tag/v2.0.0.

        .. note::
            It is suggested to set this flag :obj:`False` when the
            :class:`~optuna.pruners.MedianPruner` is used. On the other hand, it is suggested
            to set this flag :obj:`True` when the :class:`~optuna.pruners.HyperbandPruner` is
            used. Please see `the benchmark result
            <https://github.com/optuna/optuna/pull/1229>`__ for the details.

    use_separable_cma:
        If this is :obj:`True`, the covariance matrix is constrained to be diagonal.
        Due to reduce the model complexity, the learning rate for the covariance matrix
        is increased. Consequently, this algorithm outperforms CMA-ES on separable functions.

        .. note::
            Added in v2.6.0 as an experimental feature. The interface may change in newer
            versions without prior notice. See
            https://github.com/optuna/optuna/releases/tag/v2.6.0.

    with_margin:
        If this is :obj:`True`, CMA-ES with margin is used. This algorithm prevents samples in
        each discrete distribution (:class:`~optuna.distributions.FloatDistribution` with
        ``step`` and :class:`~optuna.distributions.IntDistribution`) from being fixed to a single
        point.
        Currently, this option cannot be used with ``use_separable_cma=True``.

        .. note::
            Added in v3.1.0 as an experimental feature. The interface may change in newer
            versions without prior notice. See
            https://github.com/optuna/optuna/releases/tag/v3.1.0.

    lr_adapt:
        If this is :obj:`True`, CMA-ES with learning rate adaptation is used.
        This algorithm focuses on working well on multimodal and/or noisy problems
        with default settings.
        Currently, this option cannot be used with ``use_separable_cma=True`` or
        ``with_margin=True``.

        .. note::
            Added in v3.3.0 or later, as an experimental feature.
            The interface may change in newer versions without prior notice. See
            https://github.com/optuna/optuna/releases/tag/v3.3.0.

    source_trials:
        This option is for Warm Starting CMA-ES, a method to transfer prior knowledge on
        similar HPO tasks through the initialization of CMA-ES. This method estimates a
        promising distribution from ``source_trials`` and generates the parameter of
        multivariate gaussian distribution. Please note that it is prohibited to use
        ``x0``, ``sigma0``, or ``use_separable_cma`` argument together.

        .. note::
            Added in v2.6.0 as an experimental feature. The interface may change in newer
            versions without prior notice. See
            https://github.com/optuna/optuna/releases/tag/v2.6.0.

NF)consider_pruned_trialsrestart_strategypopsizeinc_popsizeuse_separable_cmawith_marginlr_adaptsource_trialsc                  Uc  U
S:w  a2  [         R                  R                  SSSS9n[        U S3[        5        Xl        X l        U=(       d    [        R                  R                  US9U l
        X0l        XPl        [        U5      U l        [        5       U l        Xpl        Xl        Xl        Xl        Xl        Xl        U R&                  (       a  SU l        O U R(                  (       a  S	U l        OS
U l        U R"                  (       a  [1        S5        U R&                  (       a  [1        S5        U R,                  b  [1        S5        U R(                  (       a  [1        S5        U R*                  (       a  [1        S5        Ub  Uc  Ub  [3        S5      eUb  U(       a  [3        S5      eU(       a  U(       d  U(       a  [3        S5      eU R&                  (       a  U R(                  (       a  [3        S5      eg g )Nr   z`restart_strategy`z4.4.0z6.0.0)named_verr_verz~ From v4.4.0 onward, `restart_strategy` automatically falls back to `None`. `restart_strategy` will be supported in OptunaHub.)seedzsepcma:zcmawm:zcma:r   r"   r%   r#   r$   zQIt is prohibited to pass `source_trials` argument when x0 or sigma0 is specified.zNIt is prohibited to pass `source_trials` argument when using separable CMA-ES.z]It is prohibited to pass `use_separable_cma` or `with_margin` argument when using `lr_adapt`.zMCurrently, we do not support `use_separable_cma=True` and `with_margin=True`.)r	   _DEPRECATION_WARNING_TEMPLATEformatr   FutureWarning_x0_sigma0optunasamplersRandomSampler_independent_sampler_n_startup_trials_warn_independent_samplingr   _cma_rngr   _search_space_consider_pruned_trials_popsize_use_separable_cma_with_margin	_lr_adapt_source_trials_attr_prefixr   
ValueError)selfx0sigma0n_startup_trialsindependent_samplerwarn_independent_samplingr*   r   r   r    r!   r"   r#   r$   r%   msgs                   P/home/james-whalen/.local/lib/python3.13/site-packages/optuna/samplers/_cmaes.py__init__CmaEsSampler.__init__   s   $ ';"+<;;BB) C C % M M $7$c6??;X;X^b;X;c!!1*C''-46'=$"3'!+"" )D (D &D''&'?@""&':;*&7&}5>>&z2$".F<Nc 
 $):`  *k$  ""t'8'8_  (9"    c                8    U R                   R                  5         g N)r3   
reseed_rngr@   s    rG   rM   CmaEsSampler.reseed_rngO  s    !!,,.rJ   c                    0 nU R                   R                  U5      R                  5        H=  u  pEUR                  5       (       a  M  [	        U[
        [        45      (       d  M9  XSU'   M?     U$ rL   )r7   	calculateitemssingle
isinstancer   r   )r@   studytrialsearch_spacer'   distributions         rG   infer_relative_search_space(CmaEsSampler.infer_relative_search_spaceS  sk     57"&"4"4">">u"E"K"K"MD""$$ l->,PQQ!- #N rJ   c                F   U R                  U5        [        U5      S:X  a  0 $ U R                  U5      n[        U5      U R                  :  a  0 $ [	        X0R
                  (       + SS9nU R                  U5      nUc  U R                  XQR                  5      nUR                  [        UR                  5      :w  aS  U R                  (       a@  U R                  R                  R                  n[        R!                  SU S35        SU l        0 $ U R#                  XFR$                  5      n[        U5      UR&                  :  GaK  / n	US UR&                    H  n
U
R(                  c   S5       e[+        U[,        R.                  5      (       a$  [0        R2                  " U
R4                  S   5      nOUR7                  U
R8                  5      nUR                  [:        R<                  :X  a  U
R(                  OU
R(                  * nU	R?                  X45        M     URA                  U	5        [B        RD                  " U5      RG                  5       nU RI                  U5      nU H,  nURJ                  RM                  URN                  XU   5        M.     U RP                  RR                  RU                  S	S
5      URV                  -   nURX                  R[                  U5        [+        U[,        R.                  5      (       aI  UR]                  5       u  nnURJ                  RM                  URN                  SUR_                  5       5        OUR]                  5       nU R`                  nURJ                  RM                  URN                  UUR$                  5        URc                  U5      nU$ )Nr   T)transform_steptransform_0_1z7`CmaEsSampler` does not support dynamic search space. `z$` is used instead of `CmaEsSampler`.Fz"completed trials must have a value
x_for_tell   i   )2_raise_error_if_multi_objectivelen_get_trialsr4   r   r;   _restore_optimizer_init_optimizer	directiondimboundsr5   r3   	__class____name___loggerwarning_get_solution_trials
generationpopulation_sizevaluerT   r   CMAwMnparraysystem_attrs	transformparamsr   MINIMIZEappendtellpickledumpshex_split_optimizer_str_storageset_trial_system_attr	_trial_idr6   rngrandintnumber_rngr*   asktolist_attr_key_generationuntransform)r@   rU   rV   rW   completed_trialstrans	optimizerind_sampler_namesolution_trials	solutionstxyoptimizer_stroptimizer_attrskeyr*   ru   r^   generation_attr_keyexternal_valuess                        rG   sample_relativeCmaEsSampler.sample_relativee  s    	,,U3|!I++E2 4#9#99I &->->)>d
 ++,<=	,,UOODI==C--..#'#<#<#F#F#O#O ())MO 38/I 334DFZFZ[9#<#<<8:I$%@y'@'@Aww*P,PP*i55!=>A1A$.2I2IIAGGPQPWPWx  !( B NN9% #LL3779M"77FO&44U__c[^K_` ' }}  ((E2U\\AD!i--!*FJNN00z/@/@/B ]]_F"77,,OO0)2F2F	
  ++F3rJ   c                     U R                   S-   $ )Nrm   r>   rN   s    rG   r   !CmaEsSampler._attr_key_generation  s      <//rJ   c                     U R                   S-   $ )Nr   r   rN   s    rG   _attr_key_optimizer CmaEsSampler._attr_key_optimizer  s      ;..rJ   c                b   ^ ^ SR                  UU 4S j[        [        T5      5       5       5      $ )N c              3  L   >#    U  H  nTTR                    S U 3   v   M     g7f):N)r   ).0ir   r@   s     rG   	<genexpr>7CmaEsSampler._concat_optimizer_attrs.<locals>.<genexpr>  s,      
Hc1Ot778!=>Hcs   !$)joinrangera   )r@   r   s   ``rG   _concat_optimizer_attrs$CmaEsSampler._concat_optimizer_attrs  s,    ww 
HMcRaNbHc
 
 	
rJ   c                    [        U5      n0 n[        [        R                  " U[        -  5      5       H7  nU[        -  n[        US-   [        -  U5      nXU X0R                   SU 3'   M9     U$ )Nr_   r   )ra   r   mathceil_SYSTEM_ATTR_MAX_LENGTHminr   )r@   r   optimizer_lenattrsr   startends          rG   r|   !CmaEsSampler._split_optimizer_str  sw    M*tyy1H!HIJA//Eq1u 77GC7D37OE--.as34 K rJ   c                j   [        U5       H  nUR                  R                  5        VVs0 s H)  u  p4UR                  U R                  5      (       d  M'  X4_M+     nnn[        U5      S:X  a  Md  U R                  U5      n[        R                  " [        R                  U5      5      s  $    g s  snnf )Nr   )reversedrs   rR   
startswithr   ra   r   ry   loadsbytesfromhex)r@   r   rV   r   ro   r   r   s          rG   rc   CmaEsSampler._restore_optimizer  s    
 ./E #("4"4":":"<"<JC>>$":":; 
"<  
 ?#q( 88IM<<m <== 0 s   &B/B/c                   UR                   S S 2S4   nUR                   S S 2S4   n[        UR                   5      nU R                  cl  U R                  c  X4U-
  S-  -   nOUR	                  U R                  5      nU R
                  c  [        R                  " XC-
  S-  5      nOU R
                  nS nGO[        R                  /n	U R                  (       a  U	R                  [        R                  5        U[        R                  :X  a  SOSn
U R                   Vs/ s Hi  nUR                  U	;   d  M  [!        XR"                  5      (       d  M1  UR	                  UR$                  5      U
['        [(        UR*                  5      -  4PMk     nn[        U5      S:X  a  [-        S5      e[.        R0                  " U5      u  pgn[3        U[4        5      nU R6                  (       a~  [        UR                   5      S:X  a  [9        S[:        5        OT[.        R<                  " UUUR                   U R>                  R@                  RC                  SS5      S	U-  U RD                  S
9$ U RF                  (       Ga7  [        RH                  " [        URJ                  5      [(        S9n[M        URJ                  RO                  5       5       H  u  p[Q        U[R        [T        45      (       d   eURV                  b  URX                  (       a  SX'   MF  URZ                  UR\                  :X  a  SX'   Mf  URV                  UR\                  URZ                  -
  -  X'   M     [.        R^                  " UUUR                   UUU R>                  R@                  RC                  SS5      S	U-  U RD                  S9$ [.        R`                  " UUUUR                   U R>                  R@                  RC                  SS5      S	U-  U RD                  U Rb                  S9$ s  snf )Nr   r_         r   zNo compatible source_trialszSeparable CMA-ES does not operate meaningfully on single-dimensional search spaces. The setting `use_separable_cma=True` will be ignored.i
   )meansigmarg   r*   n_max_resamplingrn   )dtypeg        g      ?)r   r   rg   stepscovr*   r   rn   )r   r   r   rg   r*   r   rn   r$   )2rg   ra   r=   r.   rt   r/   rq   r   r   COMPLETEr8   rw   PRUNEDr   rv   state_is_compatible_search_spacedistributionsru   r   floatro   r?   r   get_warm_start_mgdmax_EPSr:   r   UserWarningSepCMAr6   r   r   r9   r;   emptyr7   	enumeratevaluesrT   r   r   steploglowhighrp   CMAr<   )r@   r   re   lower_boundsupper_boundsn_dimensionr   rB   r   expected_statessignr   source_solutionsr   r   dists                   rG   rd   CmaEsSampler._init_optimizer  sZ   
 ||AqD)||AqD)%,,'&xx#l'Ba&GG txx0||#!< ABC)223O++&&z'8'89 "^%<%<<1"D ,, ,A77o- I 0G I*D4qww3G,GH,    #$) !>?? !& 8 89I JD# VT"""5<< A%[ ||  <<**221i@%'+%5$(MM  HHS!4!45UCE$U%8%8%?%?%AB!$:K(LMMMM99$"EHXX*"EH#yyDII,@AEH C ;;||]]&&..q)<!#k!1 $	 	 yy<<""**1i8+- MM^^	
 		
o s   P	4P	<P	c                    U R                  U5        U R                  (       a;  U R                  U5      n[        U5      U R                  :  a  U R                  X#5        U R                  R                  XX45      $ rL   )r`   r5   rb   ra   r4   _log_independent_samplingr3   sample_independent)r@   rU   rV   
param_nameparam_distributioncomplete_trialss         rG   r   CmaEsSampler.sample_independent9  sj     	,,U3**"..u5O?#t'='==..uA((;;*
 	
rJ   c           
         [         R                  [        R                  " UUR                  U R
                  R                  R                  U R                  R                  SS95        g )NzVdynamic search space and `CategoricalDistribution` are not supported by `CmaEsSampler`)r   trial_numberindependent_sampler_namesampler_namefallback_reason)rj   rk   r   r,   r   r3   rh   ri   )r@   rV   r   s      rG   r   &CmaEsSampler._log_independent_samplingK  sM    299%"\\)-)B)B)L)L)U)U!^^44(		
rJ   c                   / nUR                  SSS9 H  nUR                  [        R                  :X  a  UR	                  U5        M4  UR                  [        R
                  :X  d  MT  [        UR                  5      S:  d  Mo  U R                  (       d  M  [        UR                  R                  5       5      u  pEUc  M  [        R                  " U5      nXVl        UR	                  U5        M     U$ )NFT)deepcopy	use_cacher   )rb   r   r   r   rw   r   ra   intermediate_valuesr8   r   rR   copyr   ro   )r@   rU   r   r   _ro   copied_ts          rG   rb   CmaEsSampler._get_trialsY  s    ""ET"BAww*---&&q):,,,--.2000q44::<====+!&&&x0 C rJ   c                    U R                   nU Vs/ s H&  oBUR                  R                  US5      :X  d  M$  UPM(     sn$ s  snf )Nr   )r   rs   get)r@   trialsrm   r   r   s        rG   rl   !CmaEsSampler._get_solution_trialsl  s@     #77!_6a1>>3E3EFY[]3^%^6___s
   #AAc                :    U R                   R                  X5        g rL   )r3   before_trial)r@   rU   rV   s      rG   r   CmaEsSampler.before_trialr  s    !!..u<rJ   c                <    U R                   R                  XX45        g rL   )r3   after_trial)r@   rU   rV   r   r   s        rG   r   CmaEsSampler.after_trialu  s     	!!--eEJrJ   )r>   r6   r8   r3   r<   r4   r9   r7   r/   r=   r:   r5   r;   r.   )NNr_   NTN)rA   zdict[str, Any] | NonerB   zfloat | NonerC   intrD   zBaseSampler | NonerE   boolr*   
int | Noner   r   r   z
str | Noner    r  r!   r   r"   r   r#   r   r$   r   r%   zlist[FrozenTrial] | NonereturnNone)r  r  )rU   'optuna.Study'rV   'optuna.trial.FrozenTrial'r  dict[str, BaseDistribution])rU   r  rV   r  rW   r  r  zdict[str, Any])r  str)r   dict[str, str]r  r  )r   r  r  r  )r   z 'list[optuna.trial.FrozenTrial]'r  z'CmaClass' | None)r   r   re   r   r  z
'CmaClass')
rU   r  rV   r  r   r  r   r   r  r   )rV   r   r   r  r  r  )rU   r  r  list[FrozenTrial])r   r	  rm   r   r  r	  )rU   zoptuna.StudyrV   r   r  r  )
rU   r  rV   r  r   r   r   zSequence[float] | Noner  r  )ri   
__module____qualname____firstlineno____doc__rH   rM   rY   r   propertyr   r   r   r|   rc   rd   r   r   rb   rl   r   r   __static_attributes__ rJ   rG   r   r   /   sI   FT %)# !26*.U (-'+""'!26!U!U U 	U
 0U $(U U !%U %U U U  U U U  0!U" 
#Un/#,F	$$KK *K 2	K
 
KZ 0 0 / /

: 
$]
$]
 "]
 
	]
~

 *
 	

 -
 

$
&`'`58`	`=KK *K 	K
 'K 
KrJ   r   c                    [        [        U R                  R                  5       5      R	                  UR                  5       5      5      nU[        U R                  5      s=:H  =(       a    [        U5      :H  $ s  $ rL   )ra   setr7   keysintersection)r   rW   intersection_sizes      rG   r   r     s`     C 3 3 8 8 :;HHIZIZI\]^E$7$7 8MMC<MMMMMrJ   )r   r   rW   r  r  r   )6
__future__r   collections.abcr   r   r   ry   typingr   r   r   r   numpyrq   r0   r	   r
   optuna._experimentalr   optuna._importsr   optuna._transformr   optuna._warningsr   optuna.distributionsr   r   r   optuna.samplersr   optuna.samplers._baser   "optuna.samplers._lazy_random_stater   optuna.search_spacer   optuna.study._study_directionr   optuna.trialr   r   r   r   r   rp   CmaClass
get_loggerri   rj   r   r   r   r   r  rJ   rG   <module>r'     s    " $             ; ' 3 ( 1 2 0 ' H > 7 8 $ # UYYekk9:H E


X
& M	K; M	K`N N0KN	NrJ   