o
    ¾e¦i¤  ã                   @   s@   d Z ddlmZ ddlmZ e e¡ZG dd„ deƒZdgZ	dS )z EfficientNet model configurationé   )ÚPreTrainedConfig)Úloggingc                +       sÚ   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,d-„Z	‡  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.
        hidden_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                    s¢   t ƒ jdi |¤Ž || _|| _|| _|| _|| _|| _|| _|| _	|	| _
|
| _|| _|| _|| _|| _|| _|| _|| _|| _|| _|| _|| _t|ƒd | _d S )Nr   © )ÚsuperÚ__init__r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   ÚsumÚnum_hidden_layers)Úselfr   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   Úkwargs©Ú	__class__r*   úy/home/ubuntu/transcripts/venv/lib/python3.10/site-packages/transformers/models/efficientnet/configuration_efficientnet.pyr,   _   s.   zEfficientNetConfig.__init__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typeÚintÚfloatÚlistÚstrr,   Ú__classcell__r*   r*   r1   r3   r      s†    Eêþýüûúùø	÷
öõôóòñðïîíìëêr   N)
r7   Úconfiguration_utilsr   Úutilsr   Ú
get_loggerr4   Úloggerr   Ú__all__r*   r*   r*   r3   Ú<module>   s   

{