

'''simple docstring'''
from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


_UpperCAmelCase  :		int  =		logging.get_logger(__name__)

_UpperCAmelCase  :		Optional[int]  =		{
    '''microsoft/swin-tiny-patch4-window7-224''': (
        '''https://huggingface.co/microsoft/swin-tiny-patch4-window7-224/resolve/main/config.json'''
    ),
    # See all Swin models at https://huggingface.co/models?filter=swin
}

class 						__magic_name__   (							__SCREAMING_SNAKE_CASE ,				__SCREAMING_SNAKE_CASE ):
 UpperCamelCase__     =       'swin'

 UpperCamelCase__     =       {
     'num_attention_heads': 'num_heads',
     'num_hidden_layers': 'num_layers',
 }







 def __init__(       self  , snake_case_=2_24  , snake_case_=4  , snake_case_=3  , snake_case_=96  , snake_case_=[2, 2, 6, 2]  , snake_case_=[3, 6, 12, 24]  , snake_case_=7  , snake_case_=4.0  , snake_case_=True  , snake_case_=0.0  , snake_case_=0.0  , snake_case_=0.1  , snake_case_="gelu"  , snake_case_=False  , snake_case_=0.02  , snake_case_=1E-5  , snake_case_=32  , snake_case_=None  , snake_case_=None  , **snake_case_  , ):
   super().__init__(**snake_case_   )

   lowercase									=image_size
   lowercase									=patch_size
   lowercase									=num_channels
   lowercase									=embed_dim
   lowercase									=depths
   lowercase									=len(snake_case_   )
   lowercase									=num_heads
   lowercase									=window_size
   lowercase									=mlp_ratio
   lowercase									=qkv_bias
   lowercase									=hidden_dropout_prob
   lowercase									=attention_probs_dropout_prob
   lowercase									=drop_path_rate
   lowercase									=hidden_act
   lowercase									=use_absolute_embeddings
   lowercase									=layer_norm_eps
   lowercase									=initializer_range
   lowercase									=encoder_stride
   # we set the hidden_size attribute in order to make Swin work with VisionEncoderDecoderModel
   # this indicates the channel dimension after the last stage of the model
   lowercase									=int(embed_dim * 2 ** (len(snake_case_   ) - 1)   )
   lowercase									=['''stem'''] + [f'stage{idx}' for idx in range(1  , len(snake_case_   ) + 1   )]
   lowercase							, lowercase									=get_aligned_output_features_output_indices(
       out_features=snake_case_  , out_indices=snake_case_  , stage_names=self.stage_names   )

class 						__magic_name__   (							__SCREAMING_SNAKE_CASE ):
 UpperCamelCase__     =       version.parse('1.11' )







 @property
 def 						_A(       self   ):
   return OrderedDict(
       [
           ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
       ]   )







 @property
 def 						_A(       self   ):
   return 1E-4

'''simple docstring'''

from collections import OrderedDict
from typing import List, Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


A_     :						Tuple    							=logging.get_logger(__name__)

A_     :						Dict    							={
    '''google/efficientnet-b7''': '''https://huggingface.co/google/efficientnet-b7/resolve/main/config.json''',
}


class     __UpperCAmelCase       ( __a		):
  __A :				Union[str, Any]											= 'efficientnet'





  def __init__(	self    ,     _lowerCamelCase = 3    ,     _lowerCamelCase = 600    ,     _lowerCamelCase = 2.0    ,     _lowerCamelCase = 3.1    ,     _lowerCamelCase = 8    ,     _lowerCamelCase = [3, 3, 5, 3, 5, 5, 3]    ,     _lowerCamelCase = [32, 16, 24, 40, 80, 112, 192]    ,     _lowerCamelCase = [16, 24, 40, 80, 112, 192, 320]    ,     _lowerCamelCase = []    ,     _lowerCamelCase = [1, 2, 2, 2, 1, 2, 1]    ,     _lowerCamelCase = [1, 2, 2, 3, 3, 4, 1]    ,     _lowerCamelCase = [1, 6, 6, 6, 6, 6, 6]    ,     _lowerCamelCase = 0.25    ,     _lowerCamelCase = "swish"    ,     _lowerCamelCase = 2560    ,     _lowerCamelCase = "mean"    ,     _lowerCamelCase = 0.02    ,     _lowerCamelCase = 0.0_01    ,     _lowerCamelCase = 0.99    ,     _lowerCamelCase = 0.5    ,     _lowerCamelCase = 0.2    ,     **_lowerCamelCase    ,     ):
     super().__init__(**_lowerCamelCase )

     lowerCAmelCase_			=      num_channels
     lowerCAmelCase_			=      image_size
     lowerCAmelCase_			=      width_coefficient
     lowerCAmelCase_			=      depth_coefficient
     lowerCAmelCase_			=      depth_divisor
     lowerCAmelCase_			=      kernel_sizes
     lowerCAmelCase_			=      in_channels
     lowerCAmelCase_			=      out_channels
     lowerCAmelCase_			=      depthwise_padding
     lowerCAmelCase_			=      strides
     lowerCAmelCase_			=      num_block_repeats
     lowerCAmelCase_			=      expand_ratios
     lowerCAmelCase_			=      squeeze_expansion_ratio
     lowerCAmelCase_			=      hidden_act
     lowerCAmelCase_			=      hidden_dim
     lowerCAmelCase_			=      pooling_type
     lowerCAmelCase_			=      initializer_range
     lowerCAmelCase_			=      batch_norm_eps
     lowerCAmelCase_			=      batch_norm_momentum
     lowerCAmelCase_			=      dropout_rate
     lowerCAmelCase_			=      drop_connect_rate
     lowerCAmelCase_			=      sum(_lowerCamelCase ) * 4






class     __UpperCAmelCase       ( __a		):
  __A :				str											= version.parse('1.11'		)





  @property
  def 						UpperCAmelCase_	(	self ):
     return OrderedDict(
         [
             ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
         ] )







  @property
  def 						UpperCAmelCase_	(	self ):
     return 1E-5





