"""simple docstring"""



from math import sqrt

import numpy as np
from sympy import symbols

# Coefficient
# Speed of light (m/s)
SCREAMING_SNAKE_CASE__:Any			=	299792458

# Symbols
SCREAMING_SNAKE_CASE__:List[str]			=	symbols("""ct x y z""")



def 					_lowerCamelCase(					a							):
       if velocity > c:
              raise ValueError("Speed must not exceed light speed 299,792,458 [m/s]!"							)
       elif velocity < 1:
              # Usually the speed should be much higher than 1 (c order of magnitude)
              raise ValueError("Speed must be greater than or equal to 1!"							)

       return velocity / c



def 					_lowerCamelCase(					a							):
       return 1 / sqrt(1 - beta(a							) ** 2							)



def 					_lowerCamelCase(					a							):
       return np.array(
           [
               [gamma(a							), -gamma(a							) * beta(a							), 0, 0],
               [-gamma(a							) * beta(a							), gamma(a							), 0, 0],
               [0, 0, 1, 0],
               [0, 0, 0, 1],
           ]							)



def 					_lowerCamelCase(					a ,  a = None							):
       # Ensure event is not empty
       if event is None:
              __a     				=  np.array([ct, x, y, z]							)  # Symbolic four vector
       else:
              event[0] *= c  # x0 is ct (speed of light * time)

       return transformation_matrix(a							) @ event


if __name__ == "__main__":
      import doctest

      doctest.testmod()

      # Example of symbolic vector:
      SCREAMING_SNAKE_CASE__:Optional[Any]			=	transform(29979245)
      print("""Example of four vector: """)
      print(F'''ct\' = {four_vector[0]}''')
      print(F'''x\' = {four_vector[1]}''')
      print(F'''y\' = {four_vector[2]}''')
      print(F'''z\' = {four_vector[3]}''')

      # Substitute symbols with numerical values
      SCREAMING_SNAKE_CASE__:Optional[Any]			=	{ct: c, x: 1, y: 1, z: 1}
      SCREAMING_SNAKE_CASE__:Any			=	[four_vector[i].subs(sub_dict) for i in range(4)]

      print(F'''\n{numerical_vector}''')

"""simple docstring"""



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


SCREAMING_SNAKE_CASE__:List[str]			=	logging.get_logger(__name__)

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






class 				snake_case__     (   snake_case_,		snake_case_   ):
 _snake_case   :			List[Any]           =		"""focalnet"""


 def __init__(				self  ,						lowerCamelCase=224  ,						lowerCamelCase=4  ,						lowerCamelCase=3  ,						lowerCamelCase=96  ,						lowerCamelCase=False  ,						lowerCamelCase=[192, 384, 768, 768]  ,						lowerCamelCase=[2, 2, 6, 2]  ,						lowerCamelCase=[2, 2, 2, 2]  ,						lowerCamelCase=[3, 3, 3, 3]  ,						lowerCamelCase="gelu"  ,						lowerCamelCase=4.0  ,						lowerCamelCase=0.0  ,						lowerCamelCase=0.1  ,						lowerCamelCase=False  ,						lowerCamelCase=1E-4  ,						lowerCamelCase=False  ,						lowerCamelCase=False  ,						lowerCamelCase=False  ,						lowerCamelCase=0.02  ,						lowerCamelCase=1E-5  ,						lowerCamelCase=32  ,						lowerCamelCase=None  ,						lowerCamelCase=None  ,						**lowerCamelCase  ,						):
        super().__init__(**lowerCamelCase		)

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