Ë
    ÛÓ^jž  ã                   óx   — d Z ddlmZ ddlmZ ddlmZ ddlmZ  ed¬«      e G d	„ d
ee«      «       «       Z	d
gZ
y)zFocalNet model configurationé    )Ústricté   )ÚBackboneConfigMixin)ÚPreTrainedConfig)Úauto_docstringzmicrosoft/focalnet-tiny)Ú
checkpointc                   ó  ‡ — e Zd ZU dZdZdZeee   z  eeef   z  e	d<   dZ
eee   z  eeef   z  e	d<   dZee	d<   d	Zee	d
<   dZee	d<   dZee   eedf   z  e	d<   dZee   eedf   z  e	d<   dZee   eedf   z  e	d<   dZee   eedf   z  e	d<   dZee	d<   dZee	d<   dZeez  e	d<   dZeez  e	d<   dZee	d<   dZee	d <   dZee	d!<   dZee	d"<   dZee	d#<   d$Zee	d%<   d&Zee	d'<   d(Z ee	d)<   d*Z!ee   d*z  e	d+<   d*Z"ee   d*z  e	d,<   ˆ fd-„Z#ˆ xZ$S ).ÚFocalNetConfiga‹  
    use_conv_embed (`bool`, *optional*, defaults to `False`):
        Whether to use convolutional embedding. The authors noted that using convolutional embedding usually
        improve the performance, but it's not used by default.
    focal_levels (`list(int)`, *optional*, defaults to `[2, 2, 2, 2]`):
        Number of focal levels in each layer of the respective stages in the encoder.
    focal_windows (`list(int)`, *optional*, defaults to `[3, 3, 3, 3]`):
        Focal window size in each layer of the respective stages in the encoder.
    hidden_dropout_prob (`float`, *optional*, defaults to 0.0):
        The dropout probability for all fully connected layers in the embeddings and encoder.
    use_layerscale (`bool`, *optional*, defaults to `False`):
        Whether to use layer scale in the encoder.
    layerscale_value (`float`, *optional*, defaults to 0.0001):
        The initial value of the layer scale.
    use_post_layernorm (`bool`, *optional*, defaults to `False`):
        Whether to use post layer normalization in the encoder.
    use_post_layernorm_in_modulation (`bool`, *optional*, defaults to `False`):
        Whether to use post layer normalization in the modulation layer.
    normalize_modulator (`bool`, *optional*, defaults to `False`):
        Whether to normalize the modulator.
    encoder_stride (`int`, *optional*, defaults to 32):
        Factor to increase the spatial resolution by in the decoder head for masked image modeling.

    Example:

    ```python
    >>> from transformers import FocalNetConfig, FocalNetModel

    >>> # Initializing a FocalNet microsoft/focalnet-tiny style configuration
    >>> configuration = FocalNetConfig()

    >>> # Initializing a model (with random weights) from the microsoft/focalnet-tiny style configuration
    >>> model = FocalNetModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úfocalnetéà   Ú
image_sizeé   Ú
patch_sizer   Únum_channelsé`   Ú	embed_dimFÚuse_conv_embed)éÀ   i€  é   r   .Úhidden_sizes)é   r   é   r   Údepths)r   r   r   r   Úfocal_levels)r   r   r   r   Úfocal_windowsÚgeluÚ
hidden_actg      @Ú	mlp_ratiog        Úhidden_dropout_probgš™™™™™¹?Údrop_path_rateÚuse_layerscaleg-Cëâ6?Úlayerscale_valueÚuse_post_layernormÚ use_post_layernorm_in_modulationÚnormalize_modulatorg{®Gáz”?Úinitializer_rangegñhãˆµøä>Úlayer_norm_epsé    Úencoder_strideNÚ_out_featuresÚ_out_indicesc                 ó  •— dgt        dt        | j                  «      dz   «      D �cg c]  }d|› �‘Œ	 c}z   | _        | j	                  |j                  dd «      |j                  dd «      ¬«       t        ‰| �  di |¤Ž y c c}w )NÚstemé   ÚstageÚout_indicesÚout_features)r0   r1   © )ÚrangeÚlenr   Ústage_namesÚ"set_output_features_output_indicesÚpopÚsuperÚ__post_init__)ÚselfÚkwargsÚidxÚ	__class__s      €ú~/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/focalnet/configuration_focalnet.pyr9   zFocalNetConfig.__post_init__Z   s�   ø€ Ø"˜8ÄÀaÌÈTÏ[É[ÓIYÐ\]ÑI]Ó@^Ö&_¸¨¨s¨e¢}Ò&_Ñ_ˆÔØ×/Ñ/ØŸ
™
 =°$Ó7ÀfÇjÁjÐQ_ÐaeÓFfð 	0ô 	
ô 	‰ÑÑ' Ó'ùò	 '`s   ¨B)%Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typer   ÚintÚlistÚtupleÚ__annotations__r   r   r   r   Úboolr   r   r   r   r   Ústrr   Úfloatr   r    r!   r"   r#   r$   r%   r&   r'   r)   r*   r+   r9   Ú__classcell__)r=   s   @r>   r
   r
      sŽ  ø… ñ$ðL €Jà47€J��d˜3‘i‘ %¨¨S¨¡/Ñ1Ó7Ø45€J��d˜3‘i‘ %¨¨S¨¡/Ñ1Ó5Ø€L�#ÓØ€IˆsÓØ €N�DÓ Ø0D€L�$�s‘)˜e C¨ H™oÑ-ÓDØ*6€FˆD�‰I˜˜c 3˜h™Ñ'Ó6Ø0<€L�$�s‘)˜e C¨ H™oÑ-Ó<Ø1=€M�4˜‘9˜u S¨# X™Ñ.Ó=Ø€J�ÓØ€IˆuÓØ'*Ð˜ ™Ó*Ø"%€N�E˜C‘KÓ%Ø €N�DÓ Ø"Ð�eÓ"Ø$Ð˜Ó$Ø-2Ð$ dÓ2Ø %Ð˜Ó%Ø#Ð�uÓ#Ø €N�EÓ Ø€N�CÓØ&*€M�4˜‘9˜tÑ#Ó*Ø%)€L�$�s‘)˜dÑ"Ó)÷(ð (ó    r
   N)rB   Úhuggingface_hub.dataclassesr   Úbackbone_utilsr   Úconfiguration_utilsr   Úutilsr   r
   Ú__all__r2   rL   r>   ú<module>rR      sQ   ðñ #å .å 1Ý 3Ý #ñ Ð4Ô5ØôF(Ð(Ð*:ó F(ó ó 6ðF(ðR Ð
�rL   