




'''simple docstring'''
from ...configuration_utils import PretrainedConfig
from ...utils import logging


_SCREAMING_SNAKE_CASE			=						logging.get_logger(__name__)

_SCREAMING_SNAKE_CASE			=						{
    "naver-clova-ix/donut-base": "https://huggingface.co/naver-clova-ix/donut-base/resolve/main/config.json",
    # See all Donut models at https://huggingface.co/models?filter=donut-swin
}
class   __UpperCAmelCase				(     lowerCAmelCase				):



					'''simple docstring'''





					_UpperCamelCase							=		"""donut-swin"""

					_UpperCamelCase							=		{
					    """num_attention_heads""": """num_heads""",
					    """num_hidden_layers""": """num_layers""",
					}



					def __init__(	self     :						List[str]      ,       _lowercase     :						Optional[int]=224      ,       _lowercase     :						Union[str, Any]=4      ,       _lowercase     :						List[Any]=3      ,       _lowercase     :						int=96      ,       _lowercase     :						Optional[Any]=[2, 2, 6, 2]      ,       _lowercase     :						int=[3, 6, 12, 24]      ,       _lowercase     :						int=7      ,       _lowercase     :						Optional[Any]=4.0      ,       _lowercase     :						List[str]=True      ,       _lowercase     :						List[Any]=0.0      ,       _lowercase     :						Dict=0.0      ,       _lowercase     :						str=0.1      ,       _lowercase     :						str="gelu"      ,       _lowercase     :						List[Any]=False      ,       _lowercase     :						Optional[int]=0.02      ,       _lowercase     :						List[str]=1E-5      ,       **_lowercase     :						str      ,       )    ->							int:
								super().__init__(**_lowercase)

								A_									= image_size
								A_									= patch_size
								A_									= num_channels
								A_									= embed_dim
								A_									= depths
								A_									= len(_lowercase)
								A_									= num_heads
								A_									= window_size
								A_									= mlp_ratio
								A_									= qkv_bias
								A_									= hidden_dropout_prob
								A_									= attention_probs_dropout_prob
								A_									= drop_path_rate
								A_									= hidden_act
								A_									= use_absolute_embeddings
								A_									= layer_norm_eps
								A_									= initializer_range
								# we set the hidden_size attribute in order to make Swin work with VisionEncoderDecoderModel
								# this indicates the channel dimension after the last stage of the model
								A_									= int(embed_dim * 2 ** (len(_lowercase) - 1))










'''simple docstring'''
import numpy as np





def 			lowerCamelCase(							SCREAMING_SNAKE_CASE_     )		->		np.array:
			return 1 / (1 + np.exp(-vector     ))





def 			lowerCamelCase(							SCREAMING_SNAKE_CASE_     )		->		np.array:
			return vector * sigmoid(1.702 * vector     )


if __name__ == "__main__":
							import doctest

							doctest.testmod()




