Ë
    Fêñi«P  ã            
      óÌ   — d dl mZ d dlZd dlmZmZmZmZ d dl	m
Z
mZmZmZmZmZ dddddgd	d
ddddœ	Zdd„Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	 	 	 	 	 d	 	 	 	 	 	 	 dd„Zy)é    )ÚannotationsN)Ú	TASK2DATAÚTASK2METRICÚget_cfgÚget_save_dir)ÚDEFAULT_CFGÚDEFAULT_CFG_DICTÚLOGGERÚNUM_THREADSÚchecksÚcolorstrzax-platformzbayesian-optimization==1.4.3Ú
hpbandsterÚConfigSpacezHEBO>=0.2.0ÚhyperoptÚ	nevergradÚoptunaÚzoopt)	ÚrandomÚaxÚbayesoptÚbohbÚhebor   r   r   r   c                óÔ  — t        | t        «      r-| j                  «       D ��ci c]  \  }}|t        |«      “Œ c}}S t        | t        «      r| D �cg c]  }t        |«      ‘Œ c}S t        | t
        «      rt        d„ | D «       «      S t        | t        j                  «      r| j                  «       S t        | t        j                  «      r| j                  «       S | S c c}}w c c}w )a#  Convert NumPy-backed Tune values into native Python types for YAML serialization.

    Args:
        value (dict): The value to convert. Can be a dict, list, tuple, NumPy scalar, or NumPy array.

    Returns:
        The converted value with NumPy types replaced by native Python types.
    c              3  ó2   K  — | ]  }t        |«      –— Œ y ­w©N)Ú_sanitize_tune_value)Ú.0Úvs     úY/var/www/pod-logistic/pod-ai/venv/lib/python3.12/site-packages/ultralytics/utils/tuner.pyú	<genexpr>z'_sanitize_tune_value.<locals>.<genexpr>%   s   è ø€ Ò<°Ô)¨!×,Ñ<ùó   ‚)Ú
isinstanceÚdictÚitemsr   ÚlistÚtupleÚnpÚgenericÚitemÚndarrayÚtolist)ÚvalueÚkr   s      r   r   r      s²   € ô �%œÔØ7<·{±{³}×E©t¨q°!�Ô'¨Ó*Ñ*ÓEÐEÜ�%œÔØ16Ö7¨AÔ$ QÕ'Ò7Ð7Ü�%œÔÜÑ<°eÔ<Ó<Ð<Ü�%œŸ™Ô$Ø�z‰z‹|ÐÜ�%œŸ™Ô$Ø�|‰|‹~ÐØ€Lùó Fùâ7s   ¤CÁC%c                óD  — | €yt        | t        «      r$| j                  «       j                  «       }|xs dS | j                  }|j
                  |j                  }}|dk(  r|j                  d«      ry|dk(  r|j                  d«      ry|dk(  r|j                  d	«      ry
y)a\  Return the normalized Ray Tune search algorithm kind for known searcher objects.

    Args:
        search_alg (str | ray.tune.search.Searcher): The search algorithm to identify. Can be None, a string, or a Ray
            Tune searcher object.

    Returns:
        str | None: The normalized search algorithm name, or None if not recognized.
    NÚAxSearchzray.tune.search.axr   ÚTuneBOHBzray.tune.search.bohbr   ÚZOOptSearchzray.tune.search.zooptr   )r"   ÚstrÚstripÚlowerÚ	__class__Ú
__module__Ú__name__Ú
startswith)Ú
search_algÚ
normalizedÚclsÚmoduleÚnames        r   Ú_get_ray_search_alg_kindr>   -   s£   € ð ÐØÜ�*œcÔ"Ø×%Ñ%Ó'×-Ñ-Ó/ˆ
ØÒ!˜TÐ!à
×
Ñ
€CØ—>‘> 3§<¡<ˆD€FØˆzÒ˜f×/Ñ/Ð0DÔEØØˆzÒ˜f×/Ñ/Ð0FÔGØØˆ}Ò ×!2Ñ!2Ð3JÔ!KØØó    c                óh   — t        j                  t        d   «       ddlm} |j                  | «      S )a  Validate that a Tune search space can be consumed by Ax.

    Args:
        space (dict): The hyperparameter search space to validate.

    Returns:
        list: The converted Ax parameters.

    Raises:
        ImportError: If the required 'ax-platform' package is not installed.
    r   r   ©r/   )r   Úcheck_requirementsÚRAY_SEARCH_ALG_REQUIREMENTSÚray.tune.search.ax.ax_searchr/   Úconvert_search_space)Úspacer/   s     r   Ú_validate_ax_search_spacerG   H   s,   € ô ×ÑÔ9¸$Ñ?Ô@å5à×(Ñ(¨Ó/Ð/r?   c                ó¢   — t        | «      }ddlm} ddlm} ddlm}  |«       }|j                  |t        |    |d¬«      i¬«        ||¬«      S )	as  Create an Ax searcher with an initialized experiment.

    Args:
        space (dict): The hyperparameter search space.
        task (str): The task type (e.g., 'detect', 'segment', 'classify').

    Returns:
        AxSearch (ray.tune.search.Searcher): The configured Ax search algorithm.

    Raises:
        ImportError: If required Ax packages are not installed.
    r   )ÚAxClient)ÚObjectivePropertiesrA   F)Úminimize)Ú
parametersÚ
objectives)Ú	ax_client)	rG   Úax.service.ax_clientrI   Úax.service.utils.instantiationrJ   rD   r/   Úcreate_experimentr   )rF   ÚtaskrL   rI   rJ   r/   rN   s          r   Ú_create_ax_searchrS   [   sT   € ô +¨5Ó1€Jå-ÝBÝ5á“
€IØ×ÑØÜ Ñ%Ñ':ÀEÔ'JÐKð  ô ñ ˜iÔ(Ð(r?   c                ól  — t        j                  t        d   «       ddl}ddlm}m}m}m}m	}m
} ddlm} ddlm}	  |	| d¬«      }
 ||
«      \  }}}|rt        d	«      ‚|j!                  «       }|D �]‹  \  }}d
j#                  d„ |D «       «      }|j%                  «       }t'        ||«      rt        d«      ‚t'        ||«      rQt'        |||f«      rC|j)                  |j+                  ||j,                  |j.                  t'        ||«      ¬«      «       Œ£t'        ||«      rWt'        |||f«      rI|j.                  dz
  }|j)                  |j1                  ||j,                  |t'        ||«      ¬«      «       �Œt'        ||«      r:t'        ||«      r.|j)                  |j3                  ||j4                  ¬«      «       �ŒLt        dt7        |«      j8                  › dt7        |j:                  «      j8                  › d�«      ‚ |D ��ci c]  \  }}d
j#                  d„ |D «       «      |“Œ  }}}||fS c c}}w )a½  Convert a Tune search space into BOHB-compatible ConfigSpace and fixed-only Tune param_space.

    Args:
        space (dict): The hyperparameter search space.

    Returns:
        (tuple): A tuple containing the ConfigSpace object and a dict of fixed parameters.

    Raises:
        ValueError: If the search space contains grid search parameters or unsupported samplers.
        ImportError: If required BOHB packages are not installed.
    r   r   N)ÚCategoricalÚFloatÚIntegerÚ
LogUniformÚ	QuantizedÚUniform©Úparse_spec_vars©Úflatten_dictT©Úprevent_delimiterzTGrid search parameters cannot be automatically converted to a TuneBOHB search space.ú/c              3  ó2   K  — | ]  }t        |«      –— Œ y ­wr   ©r2   ©r   Úps     r   r    z-_convert_bohb_search_space.<locals>.<genexpr>‘   s   è ø€ Ò, !”s˜1—vÑ,ùr!   zWTuneBOHB does not support quantized search spaces with the current ConfigSpace version.)r4   ÚupperÚlogé   )Úchoicesz-TuneBOHB does not support parameters of type z with sampler type ú.c              3  ó2   K  — | ]  }t        |«      –— Œ y ­wr   rc   rd   s     r   r    z-_convert_bohb_search_space.<locals>.<genexpr>«   ó   è ø€ Ò!7¨Q¤# a§&Ñ!7ùr!   )r   rB   rC   r   Úray.tune.search.samplerU   rV   rW   rX   rY   rZ   Ú!ray.tune.search.variant_generatorr\   Úray.tune.utilsr^   Ú
ValueErrorÚConfigurationSpaceÚjoinÚget_samplerr"   ÚaddÚUniformFloatHyperparameterr4   rf   ÚUniformIntegerHyperparameterÚCategoricalHyperparameterÚ
categoriesÚtyper7   Úsampler)rF   r   rU   rV   rW   rX   rY   rZ   r\   r^   Úresolved_spaceÚresolved_varsÚdomain_varsÚ	grid_varsÚcsÚpathÚdomainÚparrz   rf   r,   Úfixed_param_spaces                         r   Ú_convert_bohb_search_spacer„   v   s  € ô ×ÑÔ9¸&ÑAÔBãßb×bÝAÝ+á! %¸4Ô@€NÙ,;¸NÓ,KÑ)€M�; 	ÙÜÐoÓpÐpà	×	'Ñ	'Ó	)€BØ#ó ‰ˆˆfØ�h‰hÑ, tÔ,Ó,ˆØ×$Ñ$Ó&ˆÜ�g˜yÔ)ÜÐvÓwÐwä�f˜eÔ$¬°G¸gÀzÐ=RÔ)SØ�F‰FØ×6Ñ6Ø˜vŸ|™|°6·<±<ÄZÐPWÐYcÓEdð 7ó õô
 ˜ Ô(¬Z¸À'È:ÐAVÔ-WØ—L‘L 1Ñ$ˆEØ�F‰FØ×8Ñ8Ø˜vŸ|™|°5¼jÈÐR\Ó>]ð 9ó öô
 ˜ Ô,´¸GÀWÔ1MØ�F‰F�;×8Ñ8¸Àf×FWÑFWÐ8ÓXÖYäØ?ÄÀVÃ×@UÑ@UÐ?Vð W%Ü%)¨&¯.©.Ó%9×%BÑ%BÐ$CÀ1ðFóð ð-ð6 S`×`Á;À4È˜Ÿ™Ñ!7°$Ô!7Ó7¸Ñ>Ð`ÐÑ`ØÐ Ð Ð ùó as   È#H0c                óR   — t        | «      \  }}ddlm}  ||t        |   d¬«      |fS )a¬  Create a BOHB searcher using a ConfigSpace definition compatible with current ConfigSpace versions.

    Args:
        space (dict): The hyperparameter search space.
        task (str): The task type (e.g., 'detect', 'segment', 'classify').

    Returns:
        (tuple): A tuple containing the TuneBOHB searcher and fixed parameter space dict.

    Raises:
        ImportError: If required BOHB packages are not installed.
    r   )r0   Úmax)rF   ÚmetricÚmode)r„   Ú ray.tune.search.bohb.bohb_searchr0   r   )rF   rR   r   rƒ   r0   s        r   Ú_create_bohb_searchrŠ   ¯   s1   € ô 7°uÓ=Ñ€BÐå9á˜"¤[°Ñ%6¸UÔCÐEVÐVÐVr?   c                óš   — t        j                  t        d   «       ddl}ddlm}  ||j                  j                  t        |    d¬«      S )a3  Create a Nevergrad searcher with a default optimizer.

    Args:
        task (str): The task type (e.g., 'detect', 'segment', 'classify').

    Returns:
        (NevergradSearch): The configured Nevergrad search algorithm.

    Raises:
        ImportError: If the 'nevergrad' package is not installed.
    r   r   N)ÚNevergradSearchr†   )Ú	optimizerr‡   rˆ   )	r   rB   rC   r   Úray.tune.search.nevergradrŒ   Ú
optimizersÚ
OnePlusOner   )rR   ÚngrŒ   s      r   Ú_create_nevergrad_searchr’   Ã   s>   € ô ×ÑÔ9¸+ÑFÔGãÝ9á R§]¡]×%=Ñ%=ÄkÐRVÑFWÐ^cÔdÐdr?   c                ó  — t        j                  t        d   «       ddlm} ddlm} ddlm}  || d¬«      } ||«      \  }}}|D ��ci c]  \  }}dj                  d	„ |D «       «      |“Œ  }	}}|j                  | «      }
|
|	fS c c}}w )
aZ  Convert a Tune search space into ZOOpt-compatible dimensions and fixed-only Tune param_space.

    Args:
        space (dict): The hyperparameter search space.

    Returns:
        (tuple): A tuple containing the ZOOpt dimension dict and fixed parameter space dict.

    Raises:
        ImportError: If the 'zoopt' package is not installed.
    r   r   r[   ©r1   r]   Tr_   ra   c              3  ó2   K  — | ]  }t        |«      –— Œ y ­wr   rc   rd   s     r   r    z._convert_zoopt_search_space.<locals>.<genexpr>ë   rl   r!   )r   rB   rC   rn   r\   Úray.tune.search.zooptr1   ro   r^   rr   rE   )rF   r\   r1   r^   r{   r|   Ú_r€   r,   rƒ   Údim_dicts              r   Ú_convert_zoopt_search_spacer™   ×   sŒ   € ô ×ÑÔ9¸'ÑBÔCåAÝ1Ý+á! %¸4Ô@€NÙ)¨.Ó9Ñ€M�1�aØR_×`Á;À4È˜Ÿ™Ñ!7°$Ô!7Ó7¸Ñ>Ð`ÐÑ`Ø×/Ñ/°Ó6€HØÐ&Ð&Ð&ùó as   Á
#Bc                óV   — t        | «      \  }}ddlm}  |d||t        |   d¬«      |fS )aÛ  Create a ZOOpt searcher with required budget and converted search space.

    Args:
        space (dict): The hyperparameter search space.
        task (str): The task type (e.g., 'detect', 'segment', 'classify').
        iterations (int): The maximum number of trials (budget) for ZOOpt.

    Returns:
        (tuple): A tuple containing the ZOOptSearch searcher and fixed parameter space dict.

    Raises:
        ImportError: If the 'zoopt' package is not installed.
    r   r”   Úasracosr†   )ÚalgoÚbudgetr˜   r‡   rˆ   )r™   r–   r1   r   )rF   rR   Ú
iterationsr˜   rƒ   r1   s         r   Ú_create_zoopt_searchrŸ   ð   s>   € ô #>¸eÓ"DÑ€HÐå1áØ˜z°HÄ[ÐQUÑEVÐ]bôàðð r?   c                óD  — | €d|dfS t        | «      }t        | t        «      rI|sd|dfS |t        vr0dj	                  t        t        «      «      }t        d| › d|› d�«      ‚|dk(  rd||fS 	 |dk(  r/t        | t        «      rt        ||«      i |fS t        |«       | i |fS |dk(  r5t        | t        «      rt        ||«      \  }}nt        |«      \  }}| }|||fS |d	k(  rt        |«      ||fS |d
k(  r6t        | t        «      rt        |||«      \  }}nt        |«      \  }}| }|||fS t        | t        «      s| |dfS t        |   }	|	rt        j                  |	«       ddlm}
  |
|t$        |   d¬«      ||fS # t&        t(        f$ r}t)        d| › d|› �«      |‚d}~ww xY w)aç  Resolve search algorithms and normalize Tune param_space for known Ray Tune searchers.

    Args:
        search_alg (str | object | None): The search algorithm to use. Can be a string name, a pre-instantiated Ray Tune
            searcher object, or None for default behavior.
        task (str): The task type (e.g., 'detect', 'segment', 'classify').
        space (dict): The hyperparameter search space.
        iterations (int): The maximum number of trials to run.

    Returns:
        (tuple): A tuple containing (resolved_search_alg, tuner_param_space, resolved_search_alg_kind).
            - resolved_search_alg: The configured searcher or None.
            - tuner_param_space: The normalized parameter space for the tuner.
            - resolved_search_alg_kind: The normalized algorithm name or None.

    Raises:
        ValueError: If an unsupported search_alg string is provided.
        ModuleNotFoundError: If required dependencies for the chosen algorithm are not installed.
    Nz, z!Unsupported Ray Tune search_alg 'z'. Supported values: rj   r   r   r   r   r   r   )Úcreate_searcherr†   )r‡   rˆ   zRay Tune search_alg 'z4' requires additional dependencies. Original error: )r>   r"   r2   rC   rr   Úsortedrp   rS   rG   rŠ   r„   r’   rŸ   r™   r   rB   Úray.tune.searchr¡   r   ÚImportErrorÚModuleNotFoundError)r9   rR   rF   rž   r:   Ú	supportedÚresolved_search_algÚtuner_param_spacer—   Úrequirementsr¡   Úes               r   Ú_resolve_ray_search_algr«     s  € ð( ÐØ�U˜DÐ Ð ä)¨*Ó5€JÜ�*œcÔ"ÙØ˜ Ð$Ð$ØÔ8Ñ8ØŸ	™	¤&Ô)DÓ"EÓFˆIÜÐ@ÀÀÐLaÐbkÐalÐlmÐnÓoÐoØ˜Ò!Ø˜ 
Ð*Ð*ð#Ø˜ÒÜ˜*¤cÔ*Ü(¨°Ó5°r¸:ÐEÐEÜ% eÔ,Ø˜r :Ð-Ð-Ø˜ÒÜ˜*¤cÔ*Ü9LÈUÐTXÓ9YÑ6Ð#Ñ%6ä'AÀ%Ó'HÑ$�Ð$Ø&0Ð#Ø&Ð(9¸:ÐEÐEØ˜Ò$Ü+¨DÓ1°5¸*ÐDÐDØ˜Ò Ü˜*¤cÔ*Ü9MÈeÐUYÐ[eÓ9fÑ6Ð#Ñ%6ä'BÀ5Ó'IÑ$�Ð$Ø&0Ð#Ø&Ð(9¸:ÐEÐEÜ˜*¤cÔ*Ø˜u dÐ*Ð*ä2°:Ñ>ˆÙÜ×%Ñ% lÔ3å3á˜z´+¸dÑ2CÈ%ÔPÐRWÐYcÐcÐcøÜÔ,Ð-ò Ü!Ø# J <Ð/cÐdeÐcfÐgó
àð	ûðús<   Á-#E9 ÂE9 Â!9E9 ÃE9 Ã.:E9 Ä)E9 Ä>:E9 Å9FÆFÆFc                óÎ	  ‡‡‡‡‡— t        j                  d«       	 t        j                  d«       ddlŠddlmŠ ddlm} ddlm	}m
}	 	 ddl}
t        |
d	«      sJ ‚	 t        j                   ‰j"                  dd«       i d‰j%                  dd«      “d‰j%                  dd«      “d‰j%                  dd«      “d‰j%                  dd«      “d‰j%                  dd«      “d‰j%                  dd«      “d‰j%                  dd«      “d‰j%                  dd «      “d!‰j%                  dd«      “d"‰j%                  d#d$«      “d%‰j%                  dd«      “d&‰j%                  dd'«      “d(‰j%                  dd'«      “d)‰j%                  dd*«      “d+‰j%                  dd'«      “d,‰j%                  dd«      “d-‰j%                  dd.«      “‰j%                  dd«      ‰j%                  dd«      ‰j%                  dd«      ‰j%                  dd«      ‰j%                  dd«      ‰j%                  dd«      ‰j%                  dd«      ‰j%                  dd«      ‰j'                  dd/«      d0œ	¥}| j(                  }‰j+                  | «      Š‰j-                  d1d2«      Šˆˆˆˆˆfd3„}|s(‰j-                  d4«      s|}t        j.                  d5«       ‰j-                  d6t0        |   «      }||d6<   d6‰vrt        j.                  d7|› d8�«       t3        ||||«      \  }}}‰j5                  |t6        |xs dd9œ«      }‰j-                  d:«      xs t8        d:   xs d;} |d<t:        |   d=|t=        ||«      d>¬?«      }|d@k(  r |	d<t:        |   d=|d>¬A«      }t?        tA        tB        i ‰¥dB‰jE                  d4d
«      i¥«      ‰jE                  d1d2«      ¬C«      }|jG                  dDdD¬E«       ‰jH                  jK                  |«      rLt        j                  tM        dF«      › dG|› dH�«       ‰jH                  jO                  tQ        |«      |dD¬I«      }nG‰jI                  ||‰jS                  |||dJ„ dK„ ¬L«       ||jT                  |jV                  ¬M«      ¬N«      }|jY                  «        |j[                  «       }‰j]                  «        |S # t        $ r t        d«      ‚w xY w# t        t        f$ r d
}
Y �Œ†w xY w)OaÚ  Run hyperparameter tuning using Ray Tune.

    Args:
        model (YOLO): Model to run the tuner on.
        space (dict, optional): The hyperparameter search space. If not provided, uses default space.
        grace_period (int, optional): The grace period in epochs of the ASHA scheduler.
        gpu_per_trial (int, optional): The number of GPUs to allocate per trial.
        iterations (int, optional): The maximum number of trials to run.
        search_alg (str | ray.tune.search.Searcher | ray.tune.search.SearchAlgorithm, optional): Search algorithm to
            use. Strings are resolved to supported Ray Tune searchers. Pre-instantiated objects are reused, and known
            searchers with special Tune param_space requirements are normalized automatically.
        **train_args (Any): Additional arguments to pass to the `train()` method.

    Returns:
        (ray.tune.ResultGrid): A ResultGrid containing the results of the hyperparameter search.

    Examples:
        >>> from ultralytics import YOLO
        >>> model = YOLO("yolo26n.pt")  # Load a YOLO26n model

        Start tuning hyperparameters for YOLO26n training on the COCO8 dataset
        >>> result_grid = model.tune(data="coco8.yaml", use_ray=True)
    uN   ðŸ’¡ Learn about RayTune at https://docs.ultralytics.com/integrations/ray-tunez	ray[tune]r   N)Útune)Ú	RunConfig)ÚASHASchedulerÚHyperBandForBOHBzHRay Tune required but not found. To install run: pip install "ray[tune]"Ú__version__Fz>=2.0.0ÚrayÚlr0gñhãˆµøä>g{®Gáz„?Úlrfg      ð?Úmomentumgffffffæ?g\�Âõ(\ï?Úweight_decayg        gü©ñÒMbP?Úwarmup_epochsg      @Úwarmup_momentumgffffffî?Úboxg      4@r;   gš™™™™™¹?g      @Úcls_pwÚdflgš™™™™™Ù?g      (@Úhsv_hÚhsv_sgÍÌÌÌÌÌì?Úhsv_vÚdegreesg     €F@Ú	translateÚscaleÚshearg      $@é   )	ÚperspectiveÚflipudÚfliplrÚbgrÚmosaicÚmixupÚcutmixÚ
copy_pasteÚclose_mosaicr=   r­   c                ól  •— ‰j                  ‰«      }d|_        |j                  «        t        t	        | «      «      } | j                  ‰«       	 ‰	j                  «       }d|v r|j                  d«      d   n|}‰› d|› �| d<    |j                  di | ¤Ž}|j                  S # t        $ r ‰| d<   Y Œ.w xY w)zKTrain the YOLO model with the specified hyperparameters and return results.Nr—   éÿÿÿÿr=   © )ÚgetÚtrainerÚreset_callbacksr   r#   ÚupdateÚget_trial_idÚsplitÚ	ExceptionÚtrainÚresults_dict)
ÚconfigÚmodel_to_trainÚtrial_idÚtrial_suffixÚresultsÚ	base_nameÚmodel_in_storer²   Ú
train_argsr­   s
        €€€€€r   Ú_tunezrun_ray_tune.<locals>._tune¤  s¾   ø€ àŸ™ Ó0ˆØ!%ˆÔØ×&Ñ&Ô(Ü%¤d¨6£lÓ3ˆØ�‰�jÔ!ð	'Ø×(Ñ(Ó*ˆHØ69¸X±o˜8Ÿ>™>¨#Ó.¨rÒ2È8ˆLØ )˜{¨!¨L¨>Ð:ˆF�6‰Nð
 '�.×&Ñ&Ñ0¨Ñ0ˆØ×#Ñ#Ð#øô ò 	'à&ˆF�6‹Nð	'ús   Á4B" Â"B3Â2B3Úresumez6Search space not provided, using default search space.Údataz'Data not provided, using default "data=z".)ÚcpuÚgpuÚepochséd   Úepochr†   é   )Ú	time_attrr‡   rˆ   Úmax_tÚgrace_periodÚreduction_factorr   )rê   r‡   rˆ   rë   rí   Úexist_ok)r=   T)Úparentsrî   zTuner: z Resuming tuning run z...)Ú	trainableÚresume_erroredc                ó8   — | j                   › d| j                  › �S ©Nr—   ©Útrainable_namerÛ   ©Útrials    r   ú<lambda>zrun_ray_tune.<locals>.<lambda>ñ  s   € °E×4HÑ4HÐ3IÈÈ5Ï>É>ÐJZÐ1[€ r?   c                ó8   — | j                   › d| j                  › �S ró   rô   rö   s    r   rø   zrun_ray_tune.<locals>.<lambda>ò  s   € °u×7KÑ7KÐ6LÈAÈeÏnÉnÐM]Ð4^€ r?   )r9   Ú	schedulerÚnum_samplesÚtrial_name_creatorÚtrial_dirname_creator)Ústorage_pathr=   )Úparam_spaceÚtune_configÚ
run_config)/r
   Úinfor   rB   r²   r­   Úray.tuner®   Úray.tune.schedulersr¯   r°   r¤   r¥   ÚwandbÚhasattrÚAssertionErrorÚcheck_versionr±   ÚuniformÚrandintrR   ÚputrÐ   Úwarningr   r«   Úwith_resourcesr   r	   r   Úminr   r   r   ÚpopÚmkdirÚTunerÚcan_restorer   Úrestorer2   Ú
TuneConfigÚparentr=   ÚfitÚget_resultsÚshutdown)ÚmodelrF   rì   Úgpu_per_trialrž   r9   rà   r®   r¯   r°   r  Údefault_spacerR   rá   rã   r§   r¨   Úresolved_search_alg_kindÚtrainable_with_resourcesrë   rú   Útune_dirÚtunerrÝ   rÞ   rß   r²   r­   s         `                 @@@@r   Úrun_ray_tuner   N  s  ü€ ô@ ‡K�KÐ`ÔaðnÜ×!Ñ! +Ô.ãÝÝ&ßGðÛä�u˜mÔ,Ð,Ñ,ô ×Ñ˜Ÿ™¨)°UÔ;ðàˆt�|‰|˜D $Ó'ðð 	ˆt�|‰|˜D #Ó&ðð 	�D—L‘L  dÓ+ð	ð
 	˜Ÿ™ S¨%Ó0ðð 	˜Ÿ™ c¨3Ó/ðð 	˜4Ÿ<™<¨¨TÓ2ðð 	ˆt�|‰|˜C Ó&ðð 	ˆt�|‰|˜C Ó%ðð 	�$—,‘,˜s CÓ(ðð 	ˆt�|‰|˜C Ó&ðð 	�—‘˜c 3Ó'ðð 	�—‘˜c 3Ó'ðð 	�—‘˜c 3Ó'ðð 	�4—<‘<  TÓ*ðð  	�T—\‘\ # sÓ+ð!ð" 	�—‘˜c 4Ó(ð#ð$ 	�—‘˜c 4Ó(ð%ð& —|‘| C¨Ó/Ø—,‘,˜s CÓ(Ø—,‘,˜s CÓ(Ø�|‰|˜C Ó%Ø—,‘,˜s CÓ(Ø—‘˜c 3Ó'Ø—,‘,˜s CÓ(Ø—l‘l 3¨Ó,ØŸ™ Q¨Ó+ò7€Mð> �:‰:€DØ—W‘W˜U“^€NØ—‘˜v vÓ.€I÷$ð $ñ* ˜Ÿ™¨Ô1ØˆÜ�‰ÐOÔPð �>‰>˜&¤)¨D¡/Ó2€DØ€Eˆ&�MØ�ZÑÜ�‰Ð@ÀÀÀbÐIÔJäG^Ø�D˜% óHÑDÐÐ*Ð,Dð
  $×2Ñ2°5Ä+ÐVcÒVhÐghÑ:iÓjÐð �N‰N˜8Ó$ÒIÔ(8¸Ñ(BÒIÀc€EÙØÜ˜4Ñ ØØÜ˜ uÓ-Øô€Ið   6Ò)Ù$ØÜ˜tÑ$ØØØô
ˆ	ô ÜÜØKˆzÐK˜j¨*¯.©.¸À5Ó*IÐJÐKó	
ð �^‰^˜F FÓ+ô€Hð ‡N�N˜4¨$€NÔ/Ø‡z�z×Ñ˜hÔ'Ü�‰”x 	Ó*Ð+Ð+@ÀÀ
È#ÐNÔOØ—
‘
×"Ñ"¤3 x£=Ð<TÐeiÐ"Ój‰à—
‘
Ø$Ø)ØŸ™Ø.Ø#Ø&Ù#[Ù&^ð (ó ñ !¨h¯o©oÀHÇMÁMÔRð ó 
ˆð 
‡I�I„Kð ×ÑÓ!€Gð ‡L�L„Nà€NøôU ò nÜ!Ð"lÓmÐmðnûô œÐ(ò Ø‹ðús   œ-R7 Á
S Ò7SÓS$Ó#S$)r,   r#   )Né
   Nr!  N)rF   zdict | Nonerì   Úintr  z
int | Nonerž   r"  )Ú
__future__r   Únumpyr'   Úultralytics.cfgr   r   r   r   Úultralytics.utilsr   r	   r
   r   r   r   rC   r   r>   rG   rS   r„   rŠ   r’   r™   rŸ   r«   r   rÏ   r?   r   ú<module>r'     s»   ðõ #ã ç IÓ Iß b× bð Ø
Ø.Ø˜=Ð)ØØØØØñ
Ð óò,ò60ò&)ò66!òrWò(eò('ò2ò.DðR ØØ $ØØðràðrð ðrð ð	rð
 ôrr?   