
"""simple docstring"""




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


_A     :			Any  						=			logging.get_logger(__name__)

_A     :			Dict  						=			{
    """microsoft/focalnet-tiny""": """https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json""",
}

class 						a__		( UpperCamelCase_,     UpperCamelCase_		):
   __lowerCAmelCase				=							'focalnet'
   def __init__(     self      ,       _a=224      ,       _a=4      ,       _a=3      ,       _a=96      ,       _a=False      ,       _a=[192, 384, 768, 768]      ,       _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.0_2      ,       _a=1E-5      ,       _a=32      ,       _a=None      ,       _a=None      ,       **_a      ,       ):
          super().__init__(**lowercase_							)

          lowercase       :							Union[str, Any]									=				image_size
          lowercase       :							str									=				patch_size
          lowercase       :							str									=				num_channels
          lowercase       :							Tuple									=				embed_dim
          lowercase       :							Dict									=				use_conv_embed
          lowercase       :							int									=				hidden_sizes
          lowercase       :							str									=				depths
          lowercase       :							int									=				focal_levels
          lowercase       :							List[Any]									=				focal_windows
          lowercase       :							List[Any]									=				hidden_act
          lowercase       :							int									=				mlp_ratio
          lowercase       :							Any									=				hidden_dropout_prob
          lowercase       :							Optional[Any]									=				drop_path_rate
          lowercase       :							int									=				use_layerscale
          lowercase       :							str									=				layerscale_value
          lowercase       :							Dict									=				use_post_layernorm
          lowercase       :							str									=				use_post_layernorm_in_modulation
          lowercase       :							List[Any]									=				normalize_modulator
          lowercase       :							Optional[Any]									=				initializer_range
          lowercase       :							List[str]									=				layer_norm_eps
          lowercase       :							Optional[int]									=				encoder_stride
          lowercase       :							List[str]									=				['stem'] + [f"""stage{idx}""" for idx in range(1      ,       len(self.depths							) + 1							)]
          lowercase       :							Union[str, Any]									=				get_aligned_output_features_output_indices(
              out_features=lowercase_      ,       out_indices=lowercase_      ,       stage_names=self.stage_names							)






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 A    (  UpperCamelCase_       ,				UpperCamelCase_	):
      UpperCamelCase__				:    str ='focalnet'






      def __init__(   self		:	Optional[int]     ,  lowercase_		:	List[Any]=224     ,  lowercase_		:	str=4     ,  lowercase_		:	Any=3     ,  lowercase_		:	Dict=96     ,  lowercase_		:	List[str]=False     ,  lowercase_		:	Any=[192, 384, 768, 768]     ,  lowercase_		:	Dict=[2, 2, 6, 2]     ,  lowercase_		:	Optional[int]=[2, 2, 2, 2]     ,  lowercase_		:	List[Any]=[3, 3, 3, 3]     ,  lowercase_		:	Any="gelu"     ,  lowercase_		:	str=4.0     ,  lowercase_		:	List[Any]=0.0     ,  lowercase_		:	Tuple=0.1     ,  lowercase_		:	Optional[Any]=False     ,  lowercase_		:	Optional[int]=1E-4     ,  lowercase_		:	Dict=False     ,  lowercase_		:	Optional[Any]=False     ,  lowercase_		:	Dict=False     ,  lowercase_		:	List[Any]=0.02     ,  lowercase_		:	Any=1E-5     ,  lowercase_		:	Any=32     ,  lowercase_		:	List[str]=None     ,  lowercase_		:	int=None     ,  **lowercase_		:	Optional[Any]     ,  )   ->		Optional[Any]:
             """simple docstring"""




             super().__init__(**lowercase_					)

             _lowerCamelCase			:						Union[str, Any]            =image_size
             _lowerCamelCase			:						str            =patch_size
             _lowerCamelCase			:						str            =num_channels
             _lowerCamelCase			:						Tuple            =embed_dim
             _lowerCamelCase			:						Dict            =use_conv_embed
             _lowerCamelCase			:						int            =hidden_sizes
             _lowerCamelCase			:						str            =depths
             _lowerCamelCase			:						int            =focal_levels
             _lowerCamelCase			:						List[Any]            =focal_windows
             _lowerCamelCase			:						List[Any]            =hidden_act
             _lowerCamelCase			:						int            =mlp_ratio
             _lowerCamelCase			:						Any            =hidden_dropout_prob
             _lowerCamelCase			:						Optional[Any]            =drop_path_rate
             _lowerCamelCase			:						int            =use_layerscale
             _lowerCamelCase			:						str            =layerscale_value
             _lowerCamelCase			:						Dict            =use_post_layernorm
             _lowerCamelCase			:						str            =use_post_layernorm_in_modulation
             _lowerCamelCase			:						List[Any]            =normalize_modulator
             _lowerCamelCase			:						Optional[Any]            =initializer_range
             _lowerCamelCase			:						List[str]            =layer_norm_eps
             _lowerCamelCase			:						Optional[int]            =encoder_stride
             _lowerCamelCase			:						List[str]            =['stem'] + [F'''stage{idx}''' for idx in range(1     ,  len(self.depths					) + 1					)]
             _lowerCamelCase      ,	_lowerCamelCase			:						Union[str, Any]            =get_aligned_output_features_output_indices(
                 out_features=lowercase_     ,  out_indices=lowercase_     ,  stage_names=self.stage_names					)


