


"""simple docstring"""





import numpy as np





def     lowercase__	(  lowerCamelCase     :  int				,	lowerCamelCase     :  List[str]				)					->     str:
  lowerCAmelCase__    :    List[str]								=					np.array(snake_case__				)
  lowerCAmelCase__    :    Optional[int]								=					np.array(snake_case__				)

  lowerCAmelCase__    :    int								=					abs(predict - actual				)
  lowerCAmelCase__    :    List[str]								=					difference.mean()

  return score





def     lowercase__	(  lowerCamelCase     :  str				,	lowerCamelCase     :  List[Any]				)					->     Union[str, Any]:
  lowerCAmelCase__    :    Dict								=					np.array(snake_case__				)
  lowerCAmelCase__    :    Optional[int]								=					np.array(snake_case__				)

  lowerCAmelCase__    :    List[str]								=					predict - actual
  lowerCAmelCase__    :    List[str]								=					np.square(snake_case__				)

  lowerCAmelCase__    :    List[str]								=					square_diff.mean()
  return score





def     lowercase__	(  lowerCamelCase     :  int				,	lowerCamelCase     :  int				)					->     List[str]:
  lowerCAmelCase__    :    Tuple								=					np.array(snake_case__				)
  lowerCAmelCase__    :    List[Any]								=					np.array(snake_case__				)

  lowerCAmelCase__    :    List[Any]								=					predict - actual
  lowerCAmelCase__    :    List[Any]								=					np.square(snake_case__				)
  lowerCAmelCase__    :    Tuple								=					square_diff.mean()
  lowerCAmelCase__    :    int								=					np.sqrt(snake_case__				)
  return score





def     lowercase__	(  lowerCamelCase     :  int				,	lowerCamelCase     :  Tuple				)					->     List[Any]:
  lowerCAmelCase__    :    Optional[Any]								=					np.array(snake_case__				)
  lowerCAmelCase__    :    int								=					np.array(snake_case__				)

  lowerCAmelCase__    :    Dict								=					np.log(predict + 1				)
  lowerCAmelCase__    :    Optional[int]								=					np.log(actual + 1				)

  lowerCAmelCase__    :    int								=					log_predict - log_actual
  lowerCAmelCase__    :    Optional[int]								=					np.square(snake_case__				)
  lowerCAmelCase__    :    Optional[Any]								=					square_diff.mean()

  lowerCAmelCase__    :    Tuple								=					np.sqrt(snake_case__				)

  return score





def     lowercase__	(  lowerCamelCase     :  List[str]				,	lowerCamelCase     :  Optional[int]				)					->     List[Any]:
  lowerCAmelCase__    :    Any								=					np.array(snake_case__				)
  lowerCAmelCase__    :    Dict								=					np.array(snake_case__				)

  lowerCAmelCase__    :    Union[str, Any]								=					predict - actual
  lowerCAmelCase__    :    Any								=					np.sum(snake_case__				) / len(snake_case__				)
  lowerCAmelCase__    :    int								=					np.sum(snake_case__				) / len(snake_case__				)
  # print(numerator, denumerator)
  lowerCAmelCase__    :    Optional[int]								=					float(snake_case__				) / denumerator * 1_0_0

  return score







def     lowercase__	(  lowerCamelCase     :  List[Any]				,	lowerCamelCase     :  Optional[Any]				)					->     List[Any]:
  return np.mean(np.array(snake_case__				) == np.array(snake_case__				)				)




"""simple docstring"""





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


__UpperCAmelCase    				=      logging.get_logger(__name__)

__UpperCAmelCase    				=      {
    "MCG-NJU/videomae-base": "https://huggingface.co/MCG-NJU/videomae-base/resolve/main/config.json",
}

class  lowercase_  ( a_						):
      __magic_name__     :							Union[str, Any]          =				"""videomae"""







      def __init__(      self :							Dict		,  _lowercase :							int=2_2_4		,  _lowercase :							Optional[Any]=1_6		,  _lowercase :							List[Any]=3		,  _lowercase :							int=1_6		,  _lowercase :							Optional[Any]=2		,  _lowercase :							Union[str, Any]=7_6_8		,  _lowercase :							int=1_2		,  _lowercase :							Dict=1_2		,  _lowercase :							Optional[Any]=3_0_7_2		,  _lowercase :							List[str]="gelu"		,  _lowercase :							int=0.0		,  _lowercase :							int=0.0		,  _lowercase :							Optional[int]=0.02		,  _lowercase :							List[str]=1e-1_2		,  _lowercase :							Union[str, Any]=True		,  _lowercase :							Union[str, Any]=True		,  _lowercase :							Any=6		,  _lowercase :							Any=3_8_4		,  _lowercase :							int=4		,  _lowercase :							Optional[int]=1_5_3_6		,  _lowercase :							Tuple=True		,  **_lowercase :							List[str]		,  ):
        super().__init__(**_lowercase    )

        lowerCAmelCase__    :    List[Any]								=					image_size
        lowerCAmelCase__    :    Tuple								=					patch_size
        lowerCAmelCase__    :    Union[str, Any]								=					num_channels
        lowerCAmelCase__    :    Optional[Any]								=					num_frames
        lowerCAmelCase__    :    Union[str, Any]								=					tubelet_size

        lowerCAmelCase__    :    Union[str, Any]								=					hidden_size
        lowerCAmelCase__    :    Dict								=					num_hidden_layers
        lowerCAmelCase__    :    Any								=					num_attention_heads
        lowerCAmelCase__    :    List[Any]								=					intermediate_size
        lowerCAmelCase__    :    Optional[Any]								=					hidden_act
        lowerCAmelCase__    :    int								=					hidden_dropout_prob
        lowerCAmelCase__    :    Optional[Any]								=					attention_probs_dropout_prob
        lowerCAmelCase__    :    Any								=					initializer_range
        lowerCAmelCase__    :    Any								=					layer_norm_eps
        lowerCAmelCase__    :    Union[str, Any]								=					qkv_bias
        lowerCAmelCase__    :    int								=					use_mean_pooling

        lowerCAmelCase__    :    List[Any]								=					decoder_num_attention_heads
        lowerCAmelCase__    :    List[str]								=					decoder_hidden_size
        lowerCAmelCase__    :    int								=					decoder_num_hidden_layers
        lowerCAmelCase__    :    Optional[int]								=					decoder_intermediate_size
        lowerCAmelCase__    :    Optional[Any]								=					norm_pix_loss
