




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


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

lowercase__				:     Optional[Any] 		=						{
    "Visual-Attention-Network/van-base": (
        "https://huggingface.co/Visual-Attention-Network/van-base/blob/main/config.json"
    ),
}
class 		UpperCAmelCase   (				UpperCAmelCase__			):







						'''simple docstring'''





						lowerCAmelCase_     		=   '''van'''






						def __init__(						self							:     List[str]       ,	__lowercase							:     Any=2_24       ,	__lowercase							:     Tuple=3       ,	__lowercase							:     Union[str, Any]=[7, 3, 3, 3]       ,	__lowercase							:     List[str]=[4, 2, 2, 2]       ,	__lowercase							:     str=[64, 1_28, 3_20, 5_12]       ,	__lowercase							:     str=[3, 3, 12, 3]       ,	__lowercase							:     List[str]=[8, 8, 4, 4]       ,	__lowercase							:     Optional[Any]="gelu"       ,	__lowercase							:     int=0.02       ,	__lowercase							:     Optional[Any]=1E-6       ,	__lowercase							:     Optional[int]=1E-2       ,	__lowercase							:     int=0.0       ,	__lowercase							:     Tuple=0.0       ,	**__lowercase							:     Union[str, Any]       ,	):






							"""simple docstring"""






							super().__init__(**__lowercase						)
							snake_case_		    =     image_size
							snake_case_		    =     num_channels
							snake_case_		    =     patch_sizes
							snake_case_		    =     strides
							snake_case_		    =     hidden_sizes
							snake_case_		    =     depths
							snake_case_		    =     mlp_ratios
							snake_case_		    =     hidden_act
							snake_case_		    =     initializer_range
							snake_case_		    =     layer_norm_eps
							snake_case_		    =     layer_scale_init_value
							snake_case_		    =     drop_path_rate
							snake_case_		    =     dropout_rate






from torch import nn


def 						lowerCamelCase__    (		_A							):







	'''simple docstring'''





	if act_fn in ["swish", "silu"]:
		return nn.SiLU()
	elif act_fn == "mish":
		return nn.Mish()
	elif act_fn == "gelu":
		return nn.GELU()
	else:
		raise ValueError(f"Unsupported activation function: {act_fn}"							)
