
from ...configuration_utils import PretrainedConfig
from ...utils import logging


__lowerCAmelCase			:     Any           =   logging.get_logger(__name__)




class        UpperCAmelCase_			( _A     ):


  '''simple docstring'''







  a__           =		"""timm_backbone"""
  def __init__( self			: Dict			,							UpperCamelCase__			: Optional[int]=None			,							UpperCamelCase__			: Any=3			,							UpperCamelCase__			: List[str]=True			,							UpperCamelCase__			: Tuple=True			,							UpperCamelCase__			: Tuple=None			,							**UpperCamelCase__			: Any			,							)			->	Any:







    """simple docstring"""






    super().__init__(**UpperCamelCase__    )
    __magic_name__				     =       backbone
    __magic_name__				     =       num_channels
    __magic_name__				     =       features_only
    __magic_name__				     =       use_pretrained_backbone
    __magic_name__				     =       True
    __magic_name__				     =       out_indices if out_indices is not None else (-1,)



'''simple docstring'''







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


_lowercase :  int    							=       logging.get_logger(__name__)

_lowercase :  List[Any]    							=       {
    "shi-labs/nat-mini-in1k-224": "https://huggingface.co/shi-labs/nat-mini-in1k-224/resolve/main/config.json",
    # See all Nat models at https://huggingface.co/models?filter=nat
}






class  lowerCAmelCase__   (  lowerCamelCase_    ,						lowerCamelCase_     ):
					lowerCAmelCase_        =     '''nat'''

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






					def __init__(   self				,							__SCREAMING_SNAKE_CASE=4				,							__SCREAMING_SNAKE_CASE=3				,							__SCREAMING_SNAKE_CASE=64				,							__SCREAMING_SNAKE_CASE=[3, 4, 6, 5]				,							__SCREAMING_SNAKE_CASE=[2, 4, 8, 16]				,							__SCREAMING_SNAKE_CASE=7				,							__SCREAMING_SNAKE_CASE=3.0				,							__SCREAMING_SNAKE_CASE=True				,							__SCREAMING_SNAKE_CASE=0.0				,							__SCREAMING_SNAKE_CASE=0.0				,							__SCREAMING_SNAKE_CASE=0.1				,							__SCREAMING_SNAKE_CASE="gelu"				,							__SCREAMING_SNAKE_CASE=0.02				,							__SCREAMING_SNAKE_CASE=1E-5				,							__SCREAMING_SNAKE_CASE=0.0				,							__SCREAMING_SNAKE_CASE=None				,							__SCREAMING_SNAKE_CASE=None				,							**__SCREAMING_SNAKE_CASE				,							):


											"""simple docstring"""





											super().__init__(**__SCREAMING_SNAKE_CASE		)

											lowercase_	:     Optional[int]													=       patch_size
											lowercase_	:     List[Any]													=       num_channels
											lowercase_	:     str													=       embed_dim
											lowercase_	:     List[str]													=       depths
											lowercase_	:     str													=       len(__SCREAMING_SNAKE_CASE		)
											lowercase_	:     Tuple													=       num_heads
											lowercase_	:     int													=       kernel_size
											lowercase_	:     Union[str, Any]													=       mlp_ratio
											lowercase_	:     Optional[int]													=       qkv_bias
											lowercase_	:     List[Any]													=       hidden_dropout_prob
											lowercase_	:     Optional[int]													=       attention_probs_dropout_prob
											lowercase_	:     List[Any]													=       drop_path_rate
											lowercase_	:     List[Any]													=       hidden_act
											lowercase_	:     int													=       layer_norm_eps
											lowercase_	:     int													=       initializer_range
											# we set the hidden_size attribute in order to make Nat work with VisionEncoderDecoderModel
											# this indicates the channel dimension after the last stage of the model
											lowercase_	:     Dict													=       int(embed_dim * 2 ** (len(__SCREAMING_SNAKE_CASE		) - 1)		)
											lowercase_	:     Tuple													=       layer_scale_init_value
											lowercase_	:     Union[str, Any]													=       ['''stem'''] + [F'''stage{idx}''' for idx in range(1				,							len(__SCREAMING_SNAKE_CASE		) + 1		)]
											lowercase_						, lowercase_	:     int													=       get_aligned_output_features_output_indices(
											    out_features=__SCREAMING_SNAKE_CASE				,							out_indices=__SCREAMING_SNAKE_CASE				,							stage_names=self.stage_names		)



