




'''simple docstring'''







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


A     =logging.get_logger(__name__)

A     ={
    '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 			_a  (	__a							,							__a ):
       __a				:     List[str]   				=					"""nat"""

       __a				:     Optional[int]   				=					{
           """num_attention_heads""": """num_heads""",
           """num_hidden_layers""": """num_layers""",
       }
       def __init__(	self						:	Union[str, Any]   ,				lowercase						:	Optional[int]=4   ,				lowercase						:	List[str]=3   ,				lowercase						:	int=64   ,				lowercase						:	Union[str, Any]=[3, 4, 6, 5]   ,				lowercase						:	Optional[int]=[2, 4, 8, 16]   ,				lowercase						:	Any=7   ,				lowercase						:	List[Any]=3.0   ,				lowercase						:	str=True   ,				lowercase						:	Tuple=0.0   ,				lowercase						:	Any=0.0   ,				lowercase						:	Dict=0.1   ,				lowercase						:	str="gelu"   ,				lowercase						:	List[str]=0.02   ,				lowercase						:	List[Any]=1E-5   ,				lowercase						:	Optional[int]=0.0   ,				lowercase						:	Optional[int]=None   ,				lowercase						:	int=None   ,				**lowercase						:	Optional[Any]   ,				):



           '''simple docstring'''

           super().__init__(**lowercase				)

           UpperCAmelCase			       =		patch_size
           UpperCAmelCase			       =		num_channels
           UpperCAmelCase			       =		embed_dim
           UpperCAmelCase			       =		depths
           UpperCAmelCase			       =		len(lowercase				)
           UpperCAmelCase			       =		num_heads
           UpperCAmelCase			       =		kernel_size
           UpperCAmelCase			       =		mlp_ratio
           UpperCAmelCase			       =		qkv_bias
           UpperCAmelCase			       =		hidden_dropout_prob
           UpperCAmelCase			       =		attention_probs_dropout_prob
           UpperCAmelCase			       =		drop_path_rate
           UpperCAmelCase			       =		hidden_act
           UpperCAmelCase			       =		layer_norm_eps
           UpperCAmelCase			       =		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
           UpperCAmelCase			       =		int(embed_dim * 2 ** (len(lowercase				) - 1)				)
           UpperCAmelCase			       =		layer_scale_init_value
           UpperCAmelCase			       =		['''stem'''] + [f"stage{idx}" for idx in range(1   ,				len(lowercase				) + 1				)]
           UpperCAmelCase       ,     UpperCAmelCase			       =		get_aligned_output_features_output_indices(
               out_features=lowercase   ,				out_indices=lowercase   ,				stage_names=self.stage_names				)












"""simple docstring"""






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


UpperCAmelCase_   : Optional[int]   			= logging.get_logger(__name__)

UpperCAmelCase_   : Any   			= {"""openai-gpt""": """https://huggingface.co/openai-gpt/resolve/main/config.json"""}




class 							lowerCAmelCase__				(			UpperCAmelCase__ ):






      '''simple docstring'''

      __UpperCamelCase	 =  "openai-gpt"
      __UpperCamelCase	 =  {
          "max_position_embeddings": "n_positions",
          "hidden_size": "n_embd",
          "num_attention_heads": "n_head",
          "num_hidden_layers": "n_layer",
      }
      def __init__(						self     :  List[str]						,	lowercase_     :  List[str]=40478						,	lowercase_     :  List[str]=512						,	lowercase_     :  Optional[Any]=768						,	lowercase_     :  Tuple=12						,	lowercase_     :  Tuple=12						,	lowercase_     :  Union[str, Any]="gelu"						,	lowercase_     :  List[Any]=0.1						,	lowercase_     :  Tuple=0.1						,	lowercase_     :  List[Any]=0.1						,	lowercase_     :  List[Any]=1e-5						,	lowercase_     :  int=0.02						,	lowercase_     :  Optional[int]="cls_index"						,	lowercase_     :  Any=True						,	lowercase_     :  List[Any]=None						,	lowercase_     :  List[str]=True						,	lowercase_     :  Optional[Any]=0.1						,	**lowercase_     :  List[str]						,	):




          '''simple docstring'''


          SCREAMING_SNAKE_CASE_      :  Optional[int]    						=		vocab_size
          SCREAMING_SNAKE_CASE_      :  Tuple    						=		n_positions
          SCREAMING_SNAKE_CASE_      :  Optional[int]    						=		n_embd
          SCREAMING_SNAKE_CASE_      :  Dict    						=		n_layer
          SCREAMING_SNAKE_CASE_      :  Any    						=		n_head
          SCREAMING_SNAKE_CASE_      :  Union[str, Any]    						=		afn
          SCREAMING_SNAKE_CASE_      :  int    						=		resid_pdrop
          SCREAMING_SNAKE_CASE_      :  List[str]    						=		embd_pdrop
          SCREAMING_SNAKE_CASE_      :  Union[str, Any]    						=		attn_pdrop
          SCREAMING_SNAKE_CASE_      :  Union[str, Any]    						=		layer_norm_epsilon
          SCREAMING_SNAKE_CASE_      :  List[Any]    						=		initializer_range
          SCREAMING_SNAKE_CASE_      :  List[str]    						=		summary_type
          SCREAMING_SNAKE_CASE_      :  Tuple    						=		summary_use_proj
          SCREAMING_SNAKE_CASE_      :  Union[str, Any]    						=		summary_activation
          SCREAMING_SNAKE_CASE_      :  Any    						=		summary_first_dropout
          SCREAMING_SNAKE_CASE_      :  List[str]    						=		summary_proj_to_labels
          super().__init__(**lowercase_)


