§
    ‚Štjj  ã                   ó€   — d dl mZ ddlmZ ddlmZ  ed¬¦  «        e G d„ de¦  «        ¦   «         ¦   «         ZdgZd	S )
é    )Ústricté   )ÚPreTrainedConfig)Úauto_docstringzzju-community/efficientloftr)Ú
checkpointc                   óÀ  ‡ — e Zd ZU dZdZdZee         dz  ed<   dZ	ee         dz  ed<   dZ
ee         d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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 dz  ed#<   dZ!eed$<   d%Z"eed&<   d'Z#eed(<   ˆ fd)„Z$d*„ Z%ˆ xZ&S )+ÚEfficientLoFTRConfiga^
  
    stage_num_blocks (`List`, *optional*, defaults to [1, 2, 4, 14]):
        The number of blocks in each stages
    stage_stride (`List`, *optional*, defaults to [2, 1, 2, 2]):
        The stride used in each stage
    q_aggregation_kernel_size (`int`, *optional*, defaults to 4):
        The kernel size of the aggregation of query states in the fusion network
    kv_aggregation_kernel_size (`int`, *optional*, defaults to 4):
        The kernel size of the aggregation of key and value states in the fusion network
    q_aggregation_stride (`int`, *optional*, defaults to 4):
        The stride of the aggregation of query states in the fusion network
    kv_aggregation_stride (`int`, *optional*, defaults to 4):
        The stride of the aggregation of key and value states in the fusion network
    num_attention_layers (`int`, *optional*, defaults to 4):
        Number of attention layers in the LocalFeatureTransformer
    mlp_activation_function (`str`, *optional*, defaults to `"leaky_relu"`):
        Activation function used in the attention mlp layer.
    coarse_matching_skip_softmax (`bool`, *optional*, defaults to `False`):
        Whether to skip softmax or not at the coarse matching step.
    coarse_matching_threshold (`float`, *optional*, defaults to 0.2):
        The threshold for the minimum score required for a match.
    coarse_matching_temperature (`float`, *optional*, defaults to 0.1):
        The temperature to apply to the coarse similarity matrix
    coarse_matching_border_removal (`int`, *optional*, defaults to 2):
        The size of the border to remove during coarse matching
    fine_kernel_size (`int`, *optional*, defaults to 8):
        Kernel size used for the fine feature matching
    batch_norm_eps (`float`, *optional*, defaults to 1e-05):
        The epsilon used by the batch normalization layers
    fine_matching_slice_dim (`int`, *optional*, defaults to 8):
        The size of the slice used to divide the fine features for the first and second fine matching stages.
    fine_matching_regress_temperature (`float`, *optional*, defaults to 10.0):
        The temperature to apply to the fine similarity matrix

    Examples:
        ```python
        >>> from transformers import EfficientLoFTRConfig, EfficientLoFTRForKeypointMatching

        >>> # Initializing a EfficientLoFTR configuration
        >>> configuration = EfficientLoFTRConfig()

        >>> # Initializing a model from the EfficientLoFTR configuration
        >>> model = EfficientLoFTRForKeypointMatching(configuration)

        >>> # Accessing the model configuration
        >>> configuration = model.config
        ```
    ÚefficientloftrNÚstage_num_blocksÚout_featuresÚstage_strideé   Úhidden_sizeÚreluÚactivation_functioné   Úq_aggregation_kernel_sizeÚkv_aggregation_kernel_sizeÚq_aggregation_strideÚkv_aggregation_strideÚnum_attention_layersé   Únum_attention_headsg        Úattention_dropoutFÚattention_biasÚ
leaky_reluÚmlp_activation_functionÚcoarse_matching_skip_softmaxgš™™™™™É?Úcoarse_matching_thresholdgš™™™™™¹?Úcoarse_matching_temperatureé   Úcoarse_matching_border_removalÚfine_kernel_sizegñhãˆµøä>Úbatch_norm_epsÚrope_parametersÚfine_matching_slice_dimg      $@Ú!fine_matching_regress_temperatureg{®Gáz”?Úinitializer_rangec                 ó´  •‡ — ‰ j         �‰ j         ng d¢‰ _         ‰ j        �‰ j        ng d¢‰ _        ‰ j        �‰ j        ng d¢‰ _        dg‰ j        d d…         z   ‰ _        d„ t	          ‰ j        ‰ j         ¦  «        D ¦   «         ‰ _        ˆ fd„t          ‰ j         ¦  «        D ¦   «         ‰ _        ˆ fd„t          t          ‰ j         ¦  «        ¦  «        D ¦   «         ‰ _
        ‰ j        ‰ _        t          t          ‰ j        ¦  «        ¦  «        d d…         ‰ _        ‰ j        d	z  ‰ _        |                     d
d¦  «          t'          ¦   «         j        di |¤Ž d S )N)é   r!   r   é   )r!   r*   r!   r!   )é@   r,   é€   r   r*   éÿÿÿÿc                 ó.   — g | ]\  }}|gd g|d z
  z  z   ‘ŒS )r*   © )Ú.0ÚstrideÚ
num_blockss      ú}/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/models/efficientloftr/configuration_efficientloftr.pyú
<listcomp>z6EfficientLoFTRConfig.__post_init__.<locals>.<listcomp>m   s;   € ð #
ð #
ð #
Ù2D°&¸*ˆVˆH˜�s˜j¨1™nÑ-Ñ-ð#
ð #
ð #
ó    c                 ó8   •— g | ]\  }}‰j         |         g|z  ‘ŒS r0   )r   )r1   Ú	stage_idxr3   Úselfs      €r4   r5   z6EfficientLoFTRConfig.__post_init__.<locals>.<listcomp>p   s:   ø€ ð )
ð )
ð )
Ù<Q¸IÀzˆTÔ˜yÔ)Ð*¨ZÑ7ð)
ð )
ð )
r6   c                 óX   •— g | ]&}‰j         |         g‰j        |         d d…         z   ‘Œ'S )Nr.   )Ústage_in_channelsÚstage_block_out_channels)r1   r8   r9   s     €r4   r5   z6EfficientLoFTRConfig.__post_init__.<locals>.<listcomp>s   sN   ø€ ð (
ð (
ð (
àð Ô# IÔ.Ð/°$Ô2OÐPYÔ2ZÐ[^Ð\^Ð[^Ô2_Ñ_ð(
ð (
ð (
r6   r!   Úpartial_rotary_factorg      @r0   )r   r   r   r;   ÚzipÚstage_block_strideÚ	enumerater<   ÚrangeÚlenÚstage_block_in_channelsr   Únum_key_value_headsÚlistÚreversedÚfine_fusion_dimsr   Úintermediate_sizeÚ
setdefaultÚsuperÚ__post_init__)r9   ÚkwargsÚ	__class__s   ` €r4   rK   z"EfficientLoFTRConfig.__post_init__e   sž  øø€ à9=Ô9NÐ9Z Ô 5Ð 5Ð`mÐ`mÐ`mˆÔØ15Ô1BÐ1N˜DÔ-Ð-ÐT`ÐT`ÐT`ˆÔØ15Ô1BÐ1N˜DÔ-Ð-ÐTfÐTfÐTfˆÔØ"#  tÔ'8¸¸"¸Ô'=Ñ!=ˆÔð#
ð #
ÝHKÈDÔL]Ð_cÔ_tÑHuÔHuð#
ñ #
ô #
ˆÔð)
ð )
ð )
ð )
ÝU^Ð_cÔ_tÑUuÔUuð)
ñ )
ô )
ˆÔ%ð(
ð (
ð (
ð (
å"¥3 tÔ'<Ñ#=Ô#=Ñ>Ô>ð(
ñ (
ô (
ˆÔ$ð
 $(Ô#;ˆÔ Ý $¥X¨dÔ.?Ñ%@Ô%@Ñ AÔ AÀ#À2À#Ô FˆÔØ!%Ô!1°AÑ!5ˆÔØ×ÒÐ1°3Ñ7Ô7Ð7Ø�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'r6   c                 ó|   — | j         | j        d         k    r%t          d| j         › d| j        d         › �¦  «        ‚dS )zOPart of `@strict`-powered validation. Validates the architecture of the config.r.   zMhidden_size should be equal to the last value in out_features. hidden_size = z, out_features = N)r   r   Ú
ValueError)r9   s    r4   Úvalidate_architecturez*EfficientLoFTRConfig.validate_architecture~   sr   € àÔ˜tÔ0°Ô4Ò4Ð4Ýð [Ð`dÔ`pð  [ð  [ð  DHô  DUð  VXô  DYð  [ð  [ñô ð ð 5Ð4r6   )'Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typer   rE   ÚintÚ__annotations__r   r   r   r   Ústrr   r   r   r   r   r   r   Úfloatr   Úboolr   r   r   r    r"   r#   r$   r%   Údictr&   r'   r(   rK   rP   Ú__classcell__)rM   s   @r4   r	   r	      s  ø€ € € € € € ð/ð /ðb "€Jà)-Ð�d˜3”i $Ñ&Ð-Ð-Ñ-Ø%)€L�$�s”)˜dÑ"Ð)Ð)Ñ)Ø%)€L�$�s”)˜dÑ"Ð)Ð)Ñ)Ø€K�ÐÐÑØ%Ð˜Ð%Ð%Ñ%Ø%&Ð˜sÐ&Ð&Ñ&Ø&'Ð Ð'Ð'Ñ'Ø !Ð˜#Ð!Ð!Ñ!Ø!"Ð˜3Ð"Ð"Ñ"Ø !Ð˜#Ð!Ð!Ñ!Ø Ð˜Ð Ð Ñ Ø%(Ð�u˜s‘{Ð(Ð(Ñ(Ø €N�DÐ Ð Ñ Ø#/Ð˜SÐ/Ð/Ñ/Ø).Ð  $Ð.Ð.Ñ.Ø'*Ð˜uÐ*Ð*Ñ*Ø),Ð Ð,Ð,Ñ,Ø*+Ð" CÐ+Ð+Ñ+ØÐ�cÐÐÑØ €N�EÐ Ð Ñ Ø#'€O�T˜D‘[Ð'Ð'Ñ'Ø#$Ð˜SÐ$Ð$Ñ$Ø/3Ð% uÐ3Ð3Ñ3Ø#Ð�uÐ#Ð#Ñ#ð(ð (ð (ð (ð (ð2ð ð ð ð ð ð r6   r	   N)Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   r	   Ú__all__r0   r6   r4   ú<module>ra      s¤   ðð  /Ð .Ð .Ð .Ð .Ð .à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø #Ð #Ð #Ð #Ð #Ð #ð €Ð9Ð:Ñ:Ô:Øðkð kð kð kð kÐ+ñ kô kñ „ñ ;Ô:ðkð\ "Ð
"€€€r6   