
"""simple docstring"""




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


UpperCAmelCase__      :    int    							= logging.get_logger(__name__)

UpperCAmelCase__      :    Optional[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_						(a__ ,					a__  ):


				"""simple docstring"""



				__UpperCamelCase      :						Dict					       =   '''nat'''

				__UpperCamelCase      :						Tuple					       =   {
				    '''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__   ,       )					->		Dict:



											"""simple docstring"""




											super().__init__(**SCREAMING_SNAKE_CASE__    )

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






"""simple docstring"""




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


UpperCAmelCase__      :    Optional[Any]    							= logging.get_logger(__name__)

UpperCAmelCase__      :    Dict    							= {
    'MIT/ast-finetuned-audioset-10-10-0.4593': (
        'https://huggingface.co/MIT/ast-finetuned-audioset-10-10-0.4593/resolve/main/config.json'
    ),
}



class 	lowerCAmelCase_						(a__  ):


				"""simple docstring"""



				__UpperCamelCase      :						Optional[int]					       =   '''audio-spectrogram-transformer'''



				def __init__(self   ,       SCREAMING_SNAKE_CASE__=7_68   ,       SCREAMING_SNAKE_CASE__=12   ,       SCREAMING_SNAKE_CASE__=12   ,       SCREAMING_SNAKE_CASE__=30_72   ,       SCREAMING_SNAKE_CASE__="gelu"   ,       SCREAMING_SNAKE_CASE__=0.0   ,       SCREAMING_SNAKE_CASE__=0.0   ,       SCREAMING_SNAKE_CASE__=0.02   ,       SCREAMING_SNAKE_CASE__=1E-12   ,       SCREAMING_SNAKE_CASE__=16   ,       SCREAMING_SNAKE_CASE__=True   ,       SCREAMING_SNAKE_CASE__=10   ,       SCREAMING_SNAKE_CASE__=10   ,       SCREAMING_SNAKE_CASE__=10_24   ,       SCREAMING_SNAKE_CASE__=1_28   ,       **SCREAMING_SNAKE_CASE__   ,       )					->		Tuple:



											"""simple docstring"""




											super().__init__(**SCREAMING_SNAKE_CASE__    )

											SCREAMING_SNAKE_CASE__						:       Optional[Any]           =   hidden_size
											SCREAMING_SNAKE_CASE__						:       str           =   num_hidden_layers
											SCREAMING_SNAKE_CASE__						:       int           =   num_attention_heads
											SCREAMING_SNAKE_CASE__						:       Tuple           =   intermediate_size
											SCREAMING_SNAKE_CASE__						:       Optional[int]           =   hidden_act
											SCREAMING_SNAKE_CASE__						:       Any           =   hidden_dropout_prob
											SCREAMING_SNAKE_CASE__						:       List[Any]           =   attention_probs_dropout_prob
											SCREAMING_SNAKE_CASE__						:       int           =   initializer_range
											SCREAMING_SNAKE_CASE__						:       int           =   layer_norm_eps
											SCREAMING_SNAKE_CASE__						:       Dict           =   patch_size
											SCREAMING_SNAKE_CASE__						:       Optional[int]           =   qkv_bias
											SCREAMING_SNAKE_CASE__						:       Optional[int]           =   frequency_stride
											SCREAMING_SNAKE_CASE__						:       Any           =   time_stride
											SCREAMING_SNAKE_CASE__						:       Optional[int]           =   max_length
											SCREAMING_SNAKE_CASE__						:       Any           =   num_mel_bins




