





"""simple docstring"""





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


lowerCAmelCase__   	=	logging.get_logger(__name__)

lowerCAmelCase__   	=	{
    '''microsoft/focalnet-tiny''': '''https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json''',
}





class 				_lowerCamelCase					(				__UpperCAmelCase     ,	__UpperCAmelCase       ):
						UpperCAmelCase_       =	'''focalnet'''


						def __init__(self      ,							__a=2_24      ,							__a=4      ,							__a=3      ,							__a=96      ,							__a=False      ,							__a=[1_92, 3_84, 7_68, 7_68]      ,							__a=[2, 2, 6, 2]      ,							__a=[2, 2, 2, 2]      ,							__a=[3, 3, 3, 3]      ,							__a="gelu"      ,							__a=4.0      ,							__a=0.0      ,							__a=0.1      ,							__a=False      ,							__a=1e-4      ,							__a=False      ,							__a=False      ,							__a=False      ,							__a=0.02      ,							__a=1e-5      ,							__a=32      ,							__a=None      ,							__a=None      ,							**__a      ,							)       ->      Optional[Any]:
								super().__init__(**__SCREAMING_SNAKE_CASE						)

								UpperCamelCase      =		image_size
								UpperCamelCase      =		patch_size
								UpperCamelCase      =		num_channels
								UpperCamelCase      =		embed_dim
								UpperCamelCase      =		use_conv_embed
								UpperCamelCase      =		hidden_sizes
								UpperCamelCase      =		depths
								UpperCamelCase      =		focal_levels
								UpperCamelCase      =		focal_windows
								UpperCamelCase      =		hidden_act
								UpperCamelCase      =		mlp_ratio
								UpperCamelCase      =		hidden_dropout_prob
								UpperCamelCase      =		drop_path_rate
								UpperCamelCase      =		use_layerscale
								UpperCamelCase      =		layerscale_value
								UpperCamelCase      =		use_post_layernorm
								UpperCamelCase      =		use_post_layernorm_in_modulation
								UpperCamelCase      =		normalize_modulator
								UpperCamelCase      =		initializer_range
								UpperCamelCase      =		layer_norm_eps
								UpperCamelCase      =		encoder_stride
								UpperCamelCase      =		["stem"] + [F"stage{idx}" for idx in range(1      ,							len(self.depths						) + 1						)]
								UpperCamelCase      , UpperCamelCase      =		get_aligned_output_features_output_indices(
								    out_features=__SCREAMING_SNAKE_CASE      ,							out_indices=__SCREAMING_SNAKE_CASE      ,							stage_names=self.stage_names						)











import copy
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, Optional, Union

@dataclass
class     _A       :
       UpperCamelCase__  :    Optional[Union[str, Path]]											=						None
       UpperCamelCase__  :    bool											=						False
       UpperCamelCase__  :    bool											=						False
       UpperCamelCase__  :    bool											=						False
       UpperCamelCase__  :    Optional[Dict]											=						None
       UpperCamelCase__  :    Optional[str]											=						None
       UpperCamelCase__  :    bool											=						False
       UpperCamelCase__  :    bool											=						False
       UpperCamelCase__  :    bool											=						False
       UpperCamelCase__  :    bool											=						True
       UpperCamelCase__  :    Optional[int]											=						None
       UpperCamelCase__  :    int											=						1
       UpperCamelCase__  :    Optional[Union[str, bool]]											=						None
       UpperCamelCase__  :    bool											=						False
       UpperCamelCase__  :    Optional[Dict]											=						None
       UpperCamelCase__  :    Optional[str]											=						None



       def 		_lowerCamelCase			(		self							:     Union[str, Any]):


           '''simple docstring'''

           return self.__class__(**{k: copy.deepcopy(__SCREAMING_SNAKE_CASE) for k, v in self.__dict__.items()})





