
    i                         d Z ddlm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                    ZdgZy)zUperNet model configuration    )strict   )%consolidate_backbone_kwargs_to_config)PreTrainedConfig)auto_docstring   )
AutoConfigzopenmmlab/upernet-convnext-tiny)
checkpointc                        e Zd ZU dZdZdeiZdZee	z  dz  e
d<   dZee
d<   dZee
d<   d	Zee   eed
f   z  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<   dZee
d<    fdZ xZS )UperNetConfiga  
    pool_scales (`tuple[int]`, *optional*, defaults to `[1, 2, 3, 6]`):
        Pooling scales used in Pooling Pyramid Module applied on the last feature map.
    use_auxiliary_head (`bool`, *optional*, defaults to `True`):
        Whether to use an auxiliary head during training.
    auxiliary_loss_weight (`float`, *optional*, defaults to 0.4):
        Weight of the cross-entropy loss of the auxiliary head.
    auxiliary_in_channels (`int`, *optional*, defaults to 256):
        Number of input channels in the auxiliary head.
    auxiliary_channels (`int`, *optional*, defaults to 256):
        Number of channels to use in the auxiliary head.
    auxiliary_num_convs (`int`, *optional*, defaults to 1):
        Number of convolutional layers to use in the auxiliary head.
    auxiliary_concat_input (`bool`, *optional*, defaults to `False`):
        Whether to concatenate the output of the auxiliary head with the input before the classification layer.
    loss_ignore_index (`int`, *optional*, defaults to 255):
        The index that is ignored by the loss function.

    Examples:

    ```python
    >>> from transformers import UperNetConfig, UperNetForSemanticSegmentation

    >>> # Initializing a configuration
    >>> configuration = UperNetConfig()

    >>> # Initializing a model (with random weights) from the configuration
    >>> model = UperNetForSemanticSegmentation(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```upernetbackbone_configNi   hidden_sizeg{Gz?initializer_range)   r   r      .pool_scalesTuse_auxiliary_headg?auxiliary_loss_weightauxiliary_in_channels   auxiliary_channelsr   auxiliary_num_convsFauxiliary_concat_input   loss_ignore_indexc                 n    t        d| j                  ddg did|\  | _        }t        |   di | y )Nresnetout_features)stage1stage2stage3stage4)r   default_config_typedefault_config_kwargs )r   r   super__post_init__)selfkwargs	__class__s     /var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/transformers/models/upernet/configuration_upernet.pyr(   zUperNetConfig.__post_init__K   sM    'L (
 00 ( H#(
 (
$f 	''    )__name__
__module____qualname____doc__
model_typer	   sub_configsr   dictr   __annotations__r   intr   floatr   listtupler   boolr   r   r   r   r   r   r(   __classcell__)r+   s   @r,   r   r      s    B J$j1K6:OT,,t3:K#u#/;KcU38_,;###&5&(,3:,!!  #(D( s 	( 	(r-   r   N)r1   huggingface_hub.dataclassesr   backbone_utilsr   configuration_utilsr   utilsr   auto.configuration_autor	   r   __all__r&   r-   r,   <module>rB      sN    " . C 3 # 0 <=:($ :(  >:(z 
r-   