Ë
    ÛÓ^j4  ã                   ó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Hiera model configurationé    )Ústricté   )ÚBackboneConfigMixin)ÚPreTrainedConfig)Úauto_docstringzfacebook/hiera-base-224)Ú
checkpointc                   ó¤  ‡ — e Zd ZU dZdZddiZ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   eedf   z  ed<   dZe
e   eedf   z  ed<   dZeez  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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d+z  ed,<   d+Z!ed+z  ed-<   d+Z"ed+z  ed.<   d/Z#ed+z  ed0<   d1Z$eed2<   d+Z%e
e   d+z  ed3<   d+Z&e
e   d+z  ed4<   ˆ fd5„Z'd6„ Z(ˆ xZ)S )7ÚHieraConfigai  
    patch_stride (`list(int)`, *optional*, defaults to `[4, 4]`):
        The stride of the patch.
    patch_padding (`list(int)`, *optional*, defaults to `[3, 3]`):
        The padding of the patch.
    num_heads (`list(int)`, *optional*, defaults to `[1, 2, 4, 8]`):
        Number of attention heads in each layer of the Transformer encoder.
    embed_dim_multiplier (`float`, *optional*, defaults to 2.0):
        The multiplier to the dimensionality of patch embedding in each layer of the Transformer encoder.
    num_query_pool (`int`, *optional*, defaults to 3):
        The number of query pool stages.
    query_stride (`list(int)`, *optional*, defaults to `[2, 2]`):
        The stride of the query pool.
    masked_unit_size (`list(int)`, *optional*, defaults to `[8, 8]`):
        The size of the masked unit.
    masked_unit_attention (`list(bool)`, *optional*, defaults to `[True, True, False, False]`):
        Whether to use masked unit attention in each layer of the Transformer encoder.
    layer_norm_init (`float`, *optional*, defaults to 1.0):
        The initial weight value for layer normalization layers.
    decoder_depth (`int`, *optional*):
        Depth of the decoder for MAE pretraining.
    normalize_pixel_loss (`bool`, *optional*, defaults to `True`):
        Whether to normalize the pixel loss by the number of pixels.
    mask_ratio (`float`, *optional*, defaults to 0.6):
        The ratio of masked tokens in the input.

    Example:

    ```python
    >>> from transformers import HieraConfig, HieraModel

    >>> # Initializing a Hiera hiera-base-patch16-224 style configuration
    >>> configuration = HieraConfig()

    >>> # Initializing a model (with random weights) from the hiera-base-patch16-224 style configuration
    >>> model = HieraModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```ÚhieraÚnum_hidden_layersÚ
num_layersé`   Ú	embed_dim)éà   r   .Ú
image_size)é   r   Ú
patch_size)é   r   Úpatch_stride)r   r   Úpatch_paddingg      @Ú	mlp_ratio)é   r   é   r   Údepths)é   r   r   é   Ú	num_headsg       @Úembed_dim_multiplierr   Únum_query_pool)r   r   Úquery_stride)r   r   Úmasked_unit_size)TTFFÚmasked_unit_attentiong        Údrop_path_rateÚnum_channelsÚgeluÚ
hidden_actg{®Gáz”?Úinitializer_rangeg      ð?Úlayer_norm_initg�íµ ÷Æ°>Úlayer_norm_epsNÚdecoder_hidden_sizeÚdecoder_depthÚdecoder_num_headsTÚnormalize_pixel_lossg333333ã?Ú
mask_ratioÚ_out_featuresÚ_out_indicesc                 óŒ  •— t        | j                  | j                  t        | j                  «      dz
  z  z  «      | _        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 )Nr   ÚstemÚstageÚout_indicesÚout_features)r4   r5   © )Úintr   r   Úlenr   Úhidden_sizeÚrangeÚstage_namesÚ"set_output_features_output_indicesÚpopÚsuperÚ__post_init__)ÚselfÚkwargsÚidxÚ	__class__s      €úx/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/hiera/configuration_hiera.pyr?   zHieraConfig.__post_init__b   s¶   ø€ ô ˜tŸ~™~°×0IÑ0IÌcÐRV×R]ÑR]ÓN^ÐabÑNbÑ0cÑcÓdˆÔØ"˜8ÄÀaÌÈTÏ[É[ÓIYÐ\]ÑI]Ó@^Ö&_¸¨¨s¨e¢}Ò&_Ñ_ˆÔØ×/Ñ/ØŸ
™
 =°$Ó7ÀfÇjÁjÐQ_ÐaeÓFfð 	0ô 	
ô 	‰ÑÑ' Ó'ùò	 '`s   Á(Cc           
      ó¦  — | j                   d   | j                  d   t        | j                  «      dz
  z  z  dk7  rEt	        d| j                   d   › d| j                  d   › dt        | j                  «      dz
  › d�«      ‚| j
                  t        | j                  «      k\  r/t	        d| j
                  › dt        | j                  «      › d�«      ‚y	)
zOPart of `@strict`-powered validation. Validates the architecture of the config.r   r   zmasked_unit_size[0] (z() must be divisible by query_stride[0] (z/) raised to the power of the number of layers (ú)znum_query_pool (z*) must be less than the number of layers (N)r!   r    r8   r   Ú
ValueErrorr   )r@   s    rD   Úvalidate_architecturez!HieraConfig.validate_architecturel   sè   € à× Ñ  Ñ# d×&7Ñ&7¸Ñ&:¼sÀ4Ç;Á;Ó?OÐRSÑ?SÑ&TÑTÐXYÒYÜØ'¨×(=Ñ(=¸aÑ(@Ð'AÐAiÐjn×j{Ñj{Ð|}Ñj~Ðið @@Ü@CÀDÇKÁKÓ@PÐSTÑ@TÐ?UÐUVðXóð ð
 ×Ñ¤# d§k¡kÓ"2Ò2ÜØ" 4×#6Ñ#6Ð"7Ð7aÔbeÐfj×fqÑfqÓbrÐasÐstÐuóð ð 3ó    )*Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typeÚattribute_mapr   r7   Ú__annotations__r   ÚlistÚtupler   r   r   r   Úfloatr   r   r   r   r    r!   r"   Úboolr#   r$   r&   Ústrr'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r?   rH   Ú__classcell__)rC   s   @rD   r
   r
      só  ø… ñ'ðR €Jà(¨,Ð7€Mà€IˆsÓØ.8€J��S‘	˜E # s (™OÑ+Ó8Ø.4€J��S‘	˜E # s (™OÑ+Ó4Ø06€L�$�s‘)˜e C¨ H™oÑ-Ó6Ø17€M�4˜‘9˜u S¨# X™Ñ.Ó7Ø€IˆuÓØ*7€FˆD�‰I˜˜c 3˜h™Ñ'Ó7Ø-9€Iˆt�C‰y˜5  c ™?Ñ*Ó9Ø(+Ð˜% #™+Ó+Ø€N�CÓØ06€L�$�s‘)˜e C¨ H™oÑ-Ó6Ø4:Ð�d˜3‘i %¨¨S¨¡/Ñ1Ó:Ø;UÐ˜4 ™:¨¨d°C¨iÑ(8Ñ8ÓUØ"%€N�E˜C‘KÓ%Ø€L�#ÓØ€J�ÓØ#Ð�uÓ#Ø €O�UÓ Ø €N�EÓ Ø&*Ð˜˜t™Ó*Ø $€M�3˜‘:Ó$Ø$(Ð�s˜T‘zÓ(Ø(,Ð˜$ ™+Ó,Ø€J�ÓØ&*€M�4˜‘9˜tÑ#Ó*Ø%)€L�$�s‘)˜dÑ"Ó)ô(örI   r
   N)rM   Úhuggingface_hub.dataclassesr   Úbackbone_utilsr   Úconfiguration_utilsr   Úutilsr   r
   Ú__all__r6   rI   rD   ú<module>r\      sP   ðñ  å .å 1Ý 3Ý #ñ Ð4Ô5Øô^Ð%Ð'7ó ^ó ó 6ð^ðB ˆ/�rI   