


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


UpperCAmelCase__   	=							logging.get_logger(__name__)

UpperCAmelCase__   	=							{
    '''facebook/convnextv2-tiny-1k-224''': '''https://huggingface.co/facebook/convnextv2-tiny-1k-224/resolve/main/config.json''',
}







class       lowerCamelCase__   (       lowerCAmelCase   ,							lowerCAmelCase):
     SCREAMING_SNAKE_CASE__      			=			'''convnextv2'''





     def __init__(self		,     UpperCAmelCase=3		,     UpperCAmelCase=4		,     UpperCAmelCase=4		,     UpperCAmelCase=None		,     UpperCAmelCase=None		,     UpperCAmelCase="gelu"		,     UpperCAmelCase=0.02		,     UpperCAmelCase=1e-12		,     UpperCAmelCase=0.0		,     UpperCAmelCase=2_2_4		,     UpperCAmelCase=None		,     UpperCAmelCase=None		,     **UpperCAmelCase		,     )     ->   Optional[Any]:
      super().__init__(**UpperCAmelCase       )

      _lowercase							      =num_channels
      _lowercase							      =patch_size
      _lowercase							      =num_stages
      _lowercase							      =[9_6, 1_9_2, 3_8_4, 7_6_8] if hidden_sizes is None else hidden_sizes
      _lowercase							      =[3, 3, 9, 3] if depths is None else depths
      _lowercase							      =hidden_act
      _lowercase							      =initializer_range
      _lowercase							      =layer_norm_eps
      _lowercase							      =drop_path_rate
      _lowercase							      =image_size
      _lowercase							      =['''stem'''] + [f"stage{idx}" for idx in range(1		,     len(self.depths       ) + 1       )]
      _lowercase      ,    _lowercase							      =get_aligned_output_features_output_indices(
          out_features=UpperCAmelCase		,     out_indices=UpperCAmelCase		,     stage_names=self.stage_names       )








from __future__ import annotations

from decimal import Decimal
from math import *  # noqa: F403

from sympy import diff





def      lowerCAmelCase_ (       __a	,    __a	,    __a = 10**-10		)     ->		float:







  """simple docstring"""





  lowerCamelCase__:      str			  =a
  while True:
    lowerCamelCase__:      Optional[Any]			  =Decimal(__a		) - (
        Decimal(eval(__a		)		) / Decimal(eval(str(diff(__a		)		)		)		)  # noqa: S307
    )
    # This number dictates the accuracy of the answer
    if abs(eval(__a		)		) < precision:  # noqa: S307
      return float(__a		)


# Let's Execute
if __name__ == "__main__":
     # Find root of trigonometric function
     # Find value of pi
     print(f'The root of sin(x) = 0 is {newton_raphson("sin(x)", 2)}')
     # Find root of polynomial
     print(f'The root of x**2 - 5*x + 2 = 0 is {newton_raphson("x**2 - 5*x + 2", 0.4)}')
     # Find Square Root of 5
     print(f'The root of log(x) - 1 = 0 is {newton_raphson("log(x) - 1", 2)}')
     # Exponential Roots
     print(f'The root of exp(x) - 1 = 0 is {newton_raphson("exp(x) - 1", 0)}')

