Ë
    S^(hé  ã                   ó¬   — d Z ddlmZ ddlmZmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZ  ej                  e«      Z G d	„ d
e	«      Z G d„ de«      Zd
dgZy)z EfficientNet model configurationé    ©ÚOrderedDict)ÚListÚMapping)Úversioné   )ÚPretrainedConfig)Ú
OnnxConfig)Úloggingc            +       óê   ‡ — e Zd ZdZdZdddddg d¢g d	¢g d
¢g g d¢g d¢g d¢dddddddddfdedededededee   dee   dee   dee   d ee   d!ee   d"ee   d#ed$ed%ed&ed'ed(ed)ed*ed+ef*ˆ fd,„Z	ˆ xZ
S )-ÚEfficientNetConfiga#  
    This is the configuration class to store the configuration of a [`EfficientNetModel`]. It is used to instantiate an
    EfficientNet 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 EfficientNet
    [google/efficientnet-b7](https://huggingface.co/google/efficientnet-b7) architecture.

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

    Args:
        num_channels (`int`, *optional*, defaults to 3):
            The number of input channels.
        image_size (`int`, *optional*, defaults to 600):
            The input image size.
        width_coefficient (`float`, *optional*, defaults to 2.0):
            Scaling coefficient for network width at each stage.
        depth_coefficient (`float`, *optional*, defaults to 3.1):
            Scaling coefficient for network depth at each stage.
        depth_divisor `int`, *optional*, defaults to 8):
            A unit of network width.
        kernel_sizes (`List[int]`, *optional*, defaults to `[3, 3, 5, 3, 5, 5, 3]`):
            List of kernel sizes to be used in each block.
        in_channels (`List[int]`, *optional*, defaults to `[32, 16, 24, 40, 80, 112, 192]`):
            List of input channel sizes to be used in each block for convolutional layers.
        out_channels (`List[int]`, *optional*, defaults to `[16, 24, 40, 80, 112, 192, 320]`):
            List of output channel sizes to be used in each block for convolutional layers.
        depthwise_padding (`List[int]`, *optional*, defaults to `[]`):
            List of block indices with square padding.
        strides (`List[int]`, *optional*, defaults to `[1, 2, 2, 2, 1, 2, 1]`):
            List of stride sizes to be used in each block for convolutional layers.
        num_block_repeats (`List[int]`, *optional*, defaults to `[1, 2, 2, 3, 3, 4, 1]`):
            List of the number of times each block is to repeated.
        expand_ratios (`List[int]`, *optional*, defaults to `[1, 6, 6, 6, 6, 6, 6]`):
            List of scaling coefficient of each block.
        squeeze_expansion_ratio (`float`, *optional*, defaults to 0.25):
            Squeeze expansion ratio.
        hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
            The non-linear activation function (function or string) in each block. If string, `"gelu"`, `"relu"`,
            `"selu", `"gelu_new"`, `"silu"` and `"mish"` are supported.
        hiddem_dim (`int`, *optional*, defaults to 1280):
            The hidden dimension of the layer before the classification head.
        pooling_type (`str` or `function`, *optional*, defaults to `"mean"`):
            Type of final pooling to be applied before the dense classification head. Available options are [`"mean"`,
            `"max"`]
        initializer_range (`float`, *optional*, defaults to 0.02):
            The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
        batch_norm_eps (`float`, *optional*, defaults to 1e-3):
            The epsilon used by the batch normalization layers.
        batch_norm_momentum (`float`, *optional*, defaults to 0.99):
            The momentum used by the batch normalization layers.
        dropout_rate (`float`, *optional*, defaults to 0.5):
            The dropout rate to be applied before final classifier layer.
        drop_connect_rate (`float`, *optional*, defaults to 0.2):
            The drop rate for skip connections.

    Example:
    ```python
    >>> from transformers import EfficientNetConfig, EfficientNetModel

    >>> # Initializing a EfficientNet efficientnet-b7 style configuration
    >>> configuration = EfficientNetConfig()

    >>> # Initializing a model (with random weights) from the efficientnet-b7 style configuration
    >>> model = EfficientNetModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úefficientnetr   iX  g       @gÍÌÌÌÌÌ@é   )r   r   é   r   r   r   r   )é    é   é   é(   éP   ép   éÀ   )r   r   r   r   r   r   i@  )é   é   r   r   r   r   r   )r   r   r   r   r   é   r   )r   é   r   r   r   r   r   g      Ð?Úswishi 
  Úmeang{®Gáz”?gü©ñÒMbP?g®Gáz®ï?g      à?gš™™™™™É?Únum_channelsÚ
image_sizeÚwidth_coefficientÚdepth_coefficientÚdepth_divisorÚkernel_sizesÚin_channelsÚout_channelsÚdepthwise_paddingÚstridesÚnum_block_repeatsÚexpand_ratiosÚsqueeze_expansion_ratioÚ
hidden_actÚ
hidden_dimÚpooling_typeÚinitializer_rangeÚbatch_norm_epsÚbatch_norm_momentumÚdropout_rateÚdrop_connect_ratec                 óp  •— t        ‰| �  di |¤Ž || _        || _        || _        || _        || _        || _        || _        || _	        |	| _
        |
| _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        t/        |«      dz  | _        y )Nr   © )ÚsuperÚ__init__r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   ÚsumÚnum_hidden_layers)Úselfr   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   ÚkwargsÚ	__class__s                          €úy/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/transformers/models/efficientnet/configuration_efficientnet.pyr6   zEfficientNetConfig.__init__f   sÌ   ø€ ô2 	‰ÑÑ"˜6Ò"à(ˆÔØ$ˆŒØ!2ˆÔØ!2ˆÔØ*ˆÔØ(ˆÔØ&ˆÔØ(ˆÔØ!2ˆÔØˆŒØ!2ˆÔØ*ˆÔØ'>ˆÔ$Ø$ˆŒØ$ˆŒØ(ˆÔØ!2ˆÔØ,ˆÔØ#6ˆÔ Ø(ˆÔØ!2ˆÔÜ!$Ð%6Ó!7¸!Ñ!;ˆÕó    )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typeÚintÚfloatr   Ústrr6   Ú__classcell__)r;   s   @r<   r   r      sH  ø„ ñCðJ  €Jð ØØ#&Ø#&ØÚ"7Ú!?Ú"AØ')Ú2Ú'<Ú#8Ø)-Ø!ØØ"Ø#'Ø %Ø%)Ø!Ø#&ñ-0<àð0<ð ð0<ð !ð	0<ð
 !ð0<ð ð0<ð ˜3‘ið0<ð ˜#‘Yð0<ð ˜3‘ið0<ð   ™9ð0<ð �c‘ð0<ð   ™9ð0<ð ˜C‘yð0<ð "'ð0<ð ð0<ð  ð!0<ð" ð#0<ð$ !ð%0<ð& ð'0<ð( #ð)0<ð* ð+0<ð, !÷-0<ñ 0<r=   r   c                   óp   — e Zd Z ej                  d«      Zedeeee	ef   f   fd„«       Z
edefd„«       Zy)ÚEfficientNetOnnxConfigz1.11Úreturnc                 ó(   — t        ddddddœfg«      S )NÚpixel_valuesÚbatchr   ÚheightÚwidth)r   r   r   r   r   ©r9   s    r<   ÚinputszEfficientNetOnnxConfig.inputsœ   s&   € äà W°ÀHÐQXÑ!YÐZðó
ð 	
r=   c                  ó   — y)Ngñhãˆµøä>r4   rO   s    r<   Úatol_for_validationz*EfficientNetOnnxConfig.atol_for_validation¤   s   € àr=   N)r>   r?   r@   r   ÚparseÚtorch_onnx_minimum_versionÚpropertyr   rE   rC   rP   rD   rR   r4   r=   r<   rH   rH   ™   sZ   „ Ø!. §¡¨vÓ!6Ðàð
˜  W¨S°#¨XÑ%6Ð 6Ñ7ò 
ó ð
ð ð Uò ó ñr=   rH   N)rA   Úcollectionsr   Útypingr   r   Ú	packagingr   Úconfiguration_utilsr	   Úonnxr
   Úutilsr   Ú
get_loggerr>   Úloggerr   rH   Ú__all__r4   r=   r<   ú<module>r_      sY   ðñ 'å #ß  å å 3Ý Ý ð 
ˆ×	Ñ	˜HÓ	%€ôx<Ð)ô x<ôv˜Zô ð   Ð!9Ð
:�r=   