
    fThg$                     r    S r SSKJr  SSKJr  SSKJrJr  \R                  " \	5      r
 " S S\\5      rS/rg)zHiera model configuration   )PretrainedConfig)logging)BackboneConfigMixin*get_aligned_output_features_output_indicesc                      ^  \ rS rSrSrSrSS0rSSS/SS/S	S	/S
S
/S/ SQ/ SQSS
SS/SS// SQSS
SSSSSSSSSSS4U 4S jjrSrU =r	$ )HieraConfig   a+  
This is the configuration class to store the configuration of a [`HieraModel`]. It is used to instantiate a Hiera
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 Hiera
[facebook/hiera-base-224](https://huggingface.co/facebook/hiera-base-224) architecture.

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

Args:
    embed_dim (`int`, *optional*, defaults to 96):
        Dimensionality of patch embedding.
    image_size (`list(int)`, *optional*, defaults to `[224, 224]`):
        The size (resolution) of input in the format (height, width) for images
        and (frames, height, width) for videos.
    patch_size (`list(int)`, *optional*, defaults to `[7, 7]`):
        The size (resolution) of each patch.
    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.
    mlp_ratio (`float`, *optional*, defaults to 4.0):
        The ratio of mlp hidden dim to embedding dim.
    depths (`list(int)`, *optional*, defaults to `[2, 3, 16, 3]`):
        Depth of each layer in the Transformer encoder.
    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.
    drop_path_rate (`float`, *optional*, defaults to 0.0):
        The drop path rate.
    num_channels (`int`, *optional*, defaults to 3):
        The number of input channels.
    hidden_act (`str`, *optional*, defaults to `"gelu"`):
        The non-linear activation function (function or string) in the encoder. If string, `"gelu"`, `"relu"`,
        `"selu"` and `"gelu_new"` are supported.
    initializer_range (`float`, *optional*, defaults to 0.02):
        The standard deviation of the truncated_normal_initializer for initializing all weight matrices and
        the zero_initializer for initializing all bias vectors.
    layer_norm_init (`float`, *optional*, defaults to 1.0):
        The initial weight value for layer normalization layers.
    layer_norm_eps (`float`, *optional*, defaults to 1e-06):
        The epsilon used by the layer normalization layers.
    decoder_hidden_size (`int`, *optional*):
        Dimensionality of decoder embeddings for MAE pretraining.
    decoder_depth (`int`, *optional*):
        Depth of the decoder for MAE pretraining.
    decoder_num_heads (`int`, *optional*):
        Number of attention heads in each layer 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.
    out_features (`List[str]`, *optional*):
        If used as backbone, list of features to output. Can be any of `"stem"`, `"stage1"`, `"stage2"`, etc.
        (depending on how many stages the model has). If unset and `out_indices` is set, will default to the
        corresponding stages. If unset and `out_indices` is unset, will default to the last stage. Must be in the
        same order as defined in the `stage_names` attribute.
    out_indices (`List[int]`, *optional*):
        If used as backbone, list of indices of features to output. Can be any of 0, 1, 2, etc. (depending on how
        many stages the model has). If unset and `out_features` is set, will default to the corresponding stages.
        If unset and `out_features` is unset, will default to the last stage. Must be in the
        same order as defined in the `stage_names` attribute.


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`            r   g      @)   r      r   )   r   r      g       @r   r   )TTFFg        gelug{Gz?g      ?gư>NTg333333?c           
      P  > [         TU ]  " S0 UD6  US   US   [        U5      S-
  -  -  S:w  a'  [        SUS    SUS    S[        U5      S-
   S35      eU
[        U5      :  a  [        SU
 S[        U5       S35      eXl        X l        X0l        X@l        XPl        X`l	        Xpl
        Xl        [        U5      U l        Xl        Xl        Xl        Xl        Xl        Xl        Xl        UU l        UU l        UU l        UU l        UU l        UU l        UU l        UU l        UU l        [;        X[        U5      S-
  -  -  5      U l        S	/[?        S[        U5      S-   5       Vs/ s H  nS
U 3PM
     sn-   U l         [C        UUU R@                  S9u  U l"        U l#        g s  snf )N    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 (stemstage)out_featuresout_indicesstage_names )$super__init__len
ValueError	embed_dim
image_size
patch_sizepatch_stridepatch_padding	mlp_ratiodepths	num_headsr   embed_dim_multipliernum_query_poolquery_stridemasked_unit_sizemasked_unit_attentiondrop_path_ratenum_channels
hidden_actinitializer_rangelayer_norm_initlayer_norm_epsdecoder_hidden_sizedecoder_depthdecoder_num_headsnormalize_pixel_loss
mask_ratiointhidden_sizeranger   r   _out_features_out_indices)selfr#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r   r   kwargsidx	__class__s                                e/var/www/auris/envauris/lib/python3.13/site-packages/transformers/models/hiera/configuration_hiera.pyr    HieraConfig.__init__v   s   < 	"6"AaS[1_!EEJ'(8(;'<<deqrsetdu v@@CFa?PPQS 
 S[(">"22\]`ag]h\iijk  #$$(*""f+$8!,( 0%:",($!2.,#6 *!2$8!$ yCKRSO+TTU"8aVWX@Y&Z@Yse}@Y&ZZ0Z%;DL\L\1
-D- '[s   'F#)r>   r?   r7   r6   r8   r)   r0   r#   r+   r2   r<   r$   r3   r5   r4   r:   r/   r.   r(   r9   r1   r*   r   r,   r'   r%   r&   r-   r   )
__name__
__module____qualname____firstlineno____doc__
model_typeattribute_mapr    __static_attributes____classcell__)rC   s   @rD   r   r      s    Vp J(,7M :q6V!f VQ8 !7I
 I
    r   N)rJ   configuration_utilsr   utilsr   utils.backbone_utilsr   r   
get_loggerrF   loggerr   __all__r   rO   rD   <module>rV      sA      3  c 
		H	%f
%'7 f
R /rO   