

"""simple docstring"""




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


A_							:			Union[str, Any]											= logging.get_logger(__name__)

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





class    lowerCamelCase						(A__			,A__			):
			lowerCamelCase__   :		Optional[int]							=							'focalnet'

			def __init__(					self				:						List[Any]    ,				__UpperCAmelCase				:						Any=2_2_4    ,				__UpperCAmelCase				:						List[Any]=4    ,				__UpperCAmelCase				:						Union[str, Any]=3    ,				__UpperCAmelCase				:						Optional[Any]=9_6    ,				__UpperCAmelCase				:						Any=False    ,				__UpperCAmelCase				:						int=[1_9_2, 3_8_4, 7_6_8, 7_6_8]    ,				__UpperCAmelCase				:						Optional[Any]=[2, 2, 6, 2]    ,				__UpperCAmelCase				:						Dict=[2, 2, 2, 2]    ,				__UpperCAmelCase				:						Dict=[3, 3, 3, 3]    ,				__UpperCAmelCase				:						Dict="gelu"    ,				__UpperCAmelCase				:						List[Any]=4.0    ,				__UpperCAmelCase				:						int=0.0    ,				__UpperCAmelCase				:						Any=0.1    ,				__UpperCAmelCase				:						Dict=False    ,				__UpperCAmelCase				:						Any=1e-4    ,				__UpperCAmelCase				:						List[Any]=False    ,				__UpperCAmelCase				:						str=False    ,				__UpperCAmelCase				:						Any=False    ,				__UpperCAmelCase				:						Dict=0.02    ,				__UpperCAmelCase				:						Dict=1e-5    ,				__UpperCAmelCase				:						str=3_2    ,				__UpperCAmelCase				:						Tuple=None    ,				__UpperCAmelCase				:						Optional[Any]=None    ,				**__UpperCAmelCase				:						List[Any]    ,				)   ->    List[Any]:
						super().__init__(**__UpperCAmelCase       )

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





"""simple docstring"""




# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


A_							:			Dict											= {
    "configuration_efficientnet": [
        "EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "EfficientNetConfig",
        "EfficientNetOnnxConfig",
    ]
}

try:
						if not is_vision_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						A_							:			List[Any]											= ["EfficientNetImageProcessor"]

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						A_							:			Dict											= [
						    "EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST",
						    "EfficientNetForImageClassification",
						    "EfficientNetModel",
						    "EfficientNetPreTrainedModel",
						]

if TYPE_CHECKING:
						from .configuration_efficientnet import (
						    EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP,
						    EfficientNetConfig,
						    EfficientNetOnnxConfig,
						)

						try:
												if not is_vision_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .image_processing_efficientnet import EfficientNetImageProcessor

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_efficientnet import (
												    EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST,
												    EfficientNetForImageClassification,
												    EfficientNetModel,
												    EfficientNetPreTrainedModel,
												)

else:
						import sys

						A_							:			List[Any]											= _LazyModule(__name__, globals()["__file__"], _import_structure)


