
     `ia                         d dl mZmZ ddlmZ ddlmZ ddlmZ erddl	m
Z
  ej        e          Z G d d	e          Zd	gZd
S )    )TYPE_CHECKINGOptional   )PretrainedConfig)logging   )CONFIG_MAPPING)SuperPointConfigc                        e Zd ZdZdZ	 	 	 	 	 	 	 	 dd	d
dedeee                  deee                  dedede	de	f fdZ
ed             Z xZS )SuperGlueConfiga	  
    This is the configuration class to store the configuration of a [`SuperGlueModel`]. It is used to instantiate a
    SuperGlue model according to the specified arguments, defining the model architecture. Instantiating a
    configuration with the defaults will yield a similar configuration to that of the SuperGlue
    [magic-leap-community/superglue_indoor](https://huggingface.co/magic-leap-community/superglue_indoor) architecture.

    Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
    documentation from [`PretrainedConfig`] for more information.

    Args:
        keypoint_detector_config (`Union[AutoConfig, dict]`,  *optional*, defaults to `SuperPointConfig`):
            The config object or dictionary of the keypoint detector.
        hidden_size (`int`, *optional*, defaults to 256):
            The dimension of the descriptors.
        keypoint_encoder_sizes (`list[int]`, *optional*, defaults to `[32, 64, 128, 256]`):
            The sizes of the keypoint encoder layers.
        gnn_layers_types (`list[str]`, *optional*, defaults to `['self', 'cross', 'self', 'cross', 'self', 'cross', 'self', 'cross', 'self', 'cross', 'self', 'cross', 'self', 'cross', 'self', 'cross', 'self', 'cross']`):
            The types of the GNN layers. Must be either 'self' or 'cross'.
        num_attention_heads (`int`, *optional*, defaults to 4):
            The number of heads in the GNN layers.
        sinkhorn_iterations (`int`, *optional*, defaults to 100):
            The number of Sinkhorn iterations.
        matching_threshold (`float`, *optional*, defaults to 0.0):
            The matching threshold.
        initializer_range (`float`, *optional*, defaults to 0.02):
            The standard deviation of the truncated_normal_initializer for initializing all weight matrices.

    Examples:
        ```python
        >>> from transformers import SuperGlueConfig, SuperGlueModel

        >>> # Initializing a SuperGlue superglue style configuration
        >>> configuration = SuperGlueConfig()

        >>> # Initializing a model from the superglue style configuration
        >>> model = SuperGlueModel(configuration)

        >>> # Accessing the model configuration
        >>> configuration = model.config
        ```
    	superglueN      d           {Gz?keypoint_detector_configr
   hidden_sizekeypoint_encoder_sizesgnn_layers_typesnum_attention_headssinkhorn_iterationsmatching_thresholdinitializer_rangec	                 B   ||nddgdz  | _         t          d | j         D                       st          d          ||z  dk    rt          d          ||ng d| _        || _        || _        || _         || _        || _        || _        t          |t                    r1|
                    d	d
          |d	<   t          |d	                  di |}|t          d
                     }|| _        || _        d| _        d| _         t!                      j        di |	 d S )Nselfcross	   c              3      K   | ]}|d v V  	dS ))r   r   N ).0
layer_types     /home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/transformers/models/superglue/configuration_superglue.py	<genexpr>z+SuperGlueConfig.__init__.<locals>.<genexpr>V   s(      [[z:!22[[[[[[    z5All gnn_layers_types must be either 'self' or 'cross'r   z8hidden_size % num_attention_heads is different from zero)    @      r   
model_type
superpointFr    )r   all
ValueErrorr   r   r   r   r   
isinstancedictgetr	   r   r   attention_probs_dropout_prob
is_decodersuper__init__)r   r   r   r   r   r   r   r   r   kwargs	__class__s             r#   r3   zSuperGlueConfig.__init__H   s|    5E4P 0 0W]_fVgjkVk[[TEZ[[[[[ 	VTUUU,,11WXXX '=&H""N`N`N` 	# '&<# 0#6 #6 "4.55 	5M5Q5QR^`l5m5m$\2'56N|6\'] ( (*( ($ $+'5l'C'E'E$(@%!2,-)""6"""""r%   c                 .    dt          | j                  iS )Nr   )typer   )r   s    r#   sub_configszSuperGlueConfig.sub_configsu   s    *D1N,O,OPPr%   )Nr   NNr   r   r   r   )__name__
__module____qualname____doc__r)   intr   liststrfloatr3   propertyr8   __classcell__)r5   s   @r#   r   r      s        ( (T J 8<6:04#$#&$'#'+# +#"4+# +# !)c 3	+#
 #49-+# !+# !+# "+# !+# +# +# +# +# +#Z Q Q XQ Q Q Q Qr%   r   N)typingr   r   configuration_utilsr   utilsr   autor	   r*   r
   
get_loggerr9   loggerr   __all__r    r%   r#   <module>rJ      s    + * * * * * * * 3 3 3 3 3 3       ! ! ! ! ! !  .------		H	%	%\Q \Q \Q \Q \Q& \Q \Q \Q~ 
r%   