
    Z j4                     r    S r SSKJr  SSKJr  SSKJr  SSKJr  \" SS9\ " S	 S
\\5      5       5       r	S
/r
g)zHiera model configuration    )strict   )BackboneConfigMixin)PreTrainedConfig)auto_docstringzfacebook/hiera-base-224)
checkpointc                     ^  \ rS rSr% SrSrSS0rSr\\	S'   Sr
\\   \\S	4   -  \	S
'   Sr\\   \\S	4   -  \	S'   Sr\\   \\S	4   -  \	S'   Sr\\   \\S	4   -  \	S'   Sr\\	S'   Sr\\   \\S	4   -  \	S'   Sr\\   \\S	4   -  \	S'   Sr\\-  \	S'   Sr\\	S'   Sr\\   \\S	4   -  \	S'   Sr\\   \\S	4   -  \	S'   Sr\\   \\S	4   -  \	S '   S!r\\-  \	S"'   Sr\\	S#'   S$r\\	S%'   S&r\\	S''   S(r\\	S)'   S*r \\	S+'   S,r!\S,-  \	S-'   S,r"\S,-  \	S.'   S,r#\S,-  \	S/'   S0r$\S,-  \	S1'   S2r%\\	S3'   S,r&\\   S,-  \	S4'   S,r'\\   S,-  \	S5'   U 4S6 jr(S7 r)S8r*U =r+$ )9HieraConfig   a  
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{Gz?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                   > [        U R                  U R                  [        U R                  5      S-
  -  -  5      U l        S/[        S[        U R                  5      S-   5       Vs/ s H  nSU 3PM
     sn-   U l        U R                  UR                  SS 5      UR                  SS 5      S9  [        TU ],  " S0 UD6  g s  snf )Nr   stemstageout_indicesout_features)r5   r6    )intr   r   lenr   hidden_sizerangestage_names"set_output_features_output_indicespopsuper__post_init__)selfkwargsidx	__class__s      ~/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/transformers/models/hiera/configuration_hiera.pyr@   HieraConfig.__post_init__b   s     t~~0I0IcRVR]R]N^abNb0ccd"8aT[[IY\]I]@^&_@^se}@^&__//

=$7fjjQ_aeFf 	0 	
 	''	 '`s   (Cc           
         U R                   S   U R                  S   [        U R                  5      S-
  -  -  S:w  aE  [	        SU R                   S    SU R                  S    S[        U R                  5      S-
   S35      eU R
                  [        U R                  5      :  a/  [	        SU R
                   S[        U R                  5       S35      eg	)
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!   r9   r   
ValueErrorr    )rA   s    rE   validate_architecture!HieraConfig.validate_architecturel   s      #d&7&7&:s4;;?ORS?S&TTXYY'(=(=a(@'AAijnj{j{|}j~i @@@CDKK@PST@T?UUVX 
 #dkk"22"4#6#6"77abefjfqfqbrasstu  3    )r:   r<   ),__name__
__module____qualname____firstlineno____doc__
model_typeattribute_mapr   r8   __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/   r0   r1   r@   rJ   __static_attributes____classcell__)rD   s   @rE   r
   r
      s   'R J(,7MIs.8JS	E#s(O+8.4JS	E#s(O+406L$s)eCHo-617M49uS#X.7Iu*7FDIc3h'7-9ItCy5c?*9(+%#++NC06L$s)eCHo-64:d3i%S/1:;U4:dCi(88U"%NECK%L#J#u# OU  NE &*t* $M3:$$(sTz((,$+,J&*M49t#*%)L$s)d")( rL   r
   N)rQ   huggingface_hub.dataclassesr   backbone_utilsr   configuration_utilsr   utilsr   r
   __all__r7   rL   rE   <module>ra      sP      . 1 3 # 45^%'7 ^  6^B /rL   