




from typing import Any

import numpy as np





def        __UpperCAmelCase						(							lowerCamelCase_ :     np.ndarray  )       ->  bool:







			"""simple docstring"""





			return np.array_equal(lowerCamelCase_  ,							matrix.conjugate().T  )





def        __UpperCAmelCase						(							lowerCamelCase_ :     np.ndarray  ,							lowerCamelCase_ :     np.ndarray  )       ->  Any:







			"""simple docstring"""





			SCREAMING_SNAKE_CASE_   : Optional[Any]					  =      v.conjugate().T
			SCREAMING_SNAKE_CASE_   : Any					  =      v_star.dot(lowerCamelCase_  )
			assert isinstance(lowerCamelCase_  ,							np.ndarray  )
			return (v_star_dot.dot(lowerCamelCase_  )) / (v_star.dot(lowerCamelCase_  ))





def        __UpperCAmelCase						(							)       ->  None:







			"""simple docstring"""





			SCREAMING_SNAKE_CASE_   : List[Any]					  =      np.array([[2, 2 + 1J, 4], [2 - 1J, 3, 1J], [4, -1J, 1]]  )
			SCREAMING_SNAKE_CASE_   : List[str]					  =      np.array([[1], [2], [3]]  )
			assert is_hermitian(lowerCamelCase_  ), F'{a} is not hermitian.'
			print(rayleigh_quotient(lowerCamelCase_  ,							lowerCamelCase_  )  )

			SCREAMING_SNAKE_CASE_   : Any					  =      np.array([[1, 2, 4], [2, 3, -1], [4, -1, 1]]  )
			assert is_hermitian(lowerCamelCase_  ), F'{a} is not hermitian.'
			assert rayleigh_quotient(lowerCamelCase_  ,							lowerCamelCase_  ) == float(3  )


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						tests()









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


UpperCamelCase__ :   Any						=							logging.get_logger(__name__)

UpperCamelCase__ :   Any						=							{
    '''Visual-Attention-Network/van-base''': (
        '''https://huggingface.co/Visual-Attention-Network/van-base/blob/main/config.json'''
    ),
}







class 				lowerCAmelCase_       (					lowerCamelCase_							):
				__a     :       List[Any]						=     "van"






				def __init__(			self      ,snake_case__=224      ,snake_case__=3      ,snake_case__=[7, 3, 3, 3]      ,snake_case__=[4, 2, 2, 2]      ,snake_case__=[64, 128, 320, 512]      ,snake_case__=[3, 3, 12, 3]      ,snake_case__=[8, 8, 4, 4]      ,snake_case__="gelu"      ,snake_case__=0.02      ,snake_case__=1E-6      ,snake_case__=1E-2      ,snake_case__=0.0      ,snake_case__=0.0      ,**snake_case__      ,):
							super().__init__(**snake_case__ )
							SCREAMING_SNAKE_CASE_   : Tuple					  =      image_size
							SCREAMING_SNAKE_CASE_   : List[str]					  =      num_channels
							SCREAMING_SNAKE_CASE_   : Dict					  =      patch_sizes
							SCREAMING_SNAKE_CASE_   : str					  =      strides
							SCREAMING_SNAKE_CASE_   : str					  =      hidden_sizes
							SCREAMING_SNAKE_CASE_   : str					  =      depths
							SCREAMING_SNAKE_CASE_   : Optional[Any]					  =      mlp_ratios
							SCREAMING_SNAKE_CASE_   : Optional[int]					  =      hidden_act
							SCREAMING_SNAKE_CASE_   : Optional[int]					  =      initializer_range
							SCREAMING_SNAKE_CASE_   : Optional[int]					  =      layer_norm_eps
							SCREAMING_SNAKE_CASE_   : int					  =      layer_scale_init_value
							SCREAMING_SNAKE_CASE_   : Union[str, Any]					  =      drop_path_rate
							SCREAMING_SNAKE_CASE_   : List[str]					  =      dropout_rate



