



from typing import List, Optional, Union

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


A__								=						logging.get_logger(__name__)

A__								=						{
    '''huggingface/informer-tourism-monthly''': (
        '''https://huggingface.co/huggingface/informer-tourism-monthly/resolve/main/config.json'''
    ),
    # See all Informer models at https://huggingface.co/models?filter=informer
}


class       a							(			__lowerCamelCase				):
		__lowerCAmelCase	:    List[Any]											=					"""informer"""
		__lowerCAmelCase	:    List[Any]											=					{
		    """hidden_size""": """d_model""",
		    """num_attention_heads""": """encoder_attention_heads""",
		    """num_hidden_layers""": """encoder_layers""",
		}



		def __init__(     self     :Any   ,__lowercase     :Optional[int] = None   ,__lowercase     :Optional[int] = None   ,__lowercase     :str = "student_t"   ,__lowercase     :str = "nll"   ,__lowercase     :int = 1   ,__lowercase     :List[int] = None   ,__lowercase     :Optional[Union[str, bool]] = "mean"   ,__lowercase     :int = 0   ,__lowercase     :int = 0   ,__lowercase     :int = 0   ,__lowercase     :int = 0   ,__lowercase     :Optional[List[int]] = None   ,__lowercase     :Optional[List[int]] = None   ,__lowercase     :int = 6_4   ,__lowercase     :int = 3_2   ,__lowercase     :int = 3_2   ,__lowercase     :int = 2   ,__lowercase     :int = 2   ,__lowercase     :int = 2   ,__lowercase     :int = 2   ,__lowercase     :bool = True   ,__lowercase     :str = "gelu"   ,__lowercase     :float = 0.05   ,__lowercase     :float = 0.1   ,__lowercase     :float = 0.1   ,__lowercase     :float = 0.1   ,__lowercase     :float = 0.1   ,__lowercase     :int = 1_0_0   ,__lowercase     :float = 0.02   ,__lowercase     :List[Any]=True   ,__lowercase     :str = "prob"   ,__lowercase     :int = 5   ,__lowercase     :bool = True   ,**__lowercase     :Optional[Any]   ,):
						# time series specific configuration
						snake_case__	:      Optional[Any]     		=	prediction_length
						snake_case__	:      Tuple     		=	context_length or prediction_length
						snake_case__	:      Dict     		=	distribution_output
						snake_case__	:      List[str]     		=	loss
						snake_case__	:      Dict     		=	input_size
						snake_case__	:      str     		=	num_time_features
						snake_case__	:      List[str]     		=	lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
						snake_case__	:      List[str]     		=	scaling
						snake_case__	:      List[str]     		=	num_dynamic_real_features
						snake_case__	:      List[str]     		=	num_static_real_features
						snake_case__	:      int     		=	num_static_categorical_features

						# set cardinality
						if cardinality and num_static_categorical_features > 0:
										if len(__lowercase  ) != num_static_categorical_features:
														raise ValueError(
														    '''The cardinality should be a list of the same length as `num_static_categorical_features`'''  )
										snake_case__	:      Optional[Any]     		=	cardinality
						else:
										snake_case__	:      Optional[Any]     		=	[0]

						# set embedding_dimension
						if embedding_dimension and num_static_categorical_features > 0:
										if len(__lowercase  ) != num_static_categorical_features:
														raise ValueError(
														    '''The embedding dimension should be a list of the same length as `num_static_categorical_features`'''  )
										snake_case__	:      str     		=	embedding_dimension
						else:
										snake_case__	:      Any     		=	[min(5_0   ,(cat + 1) // 2  ) for cat in self.cardinality]

						snake_case__	:      Optional[int]     		=	num_parallel_samples

						# Transformer architecture configuration
						snake_case__	:      int     		=	input_size * len(self.lags_sequence  ) + self._number_of_features
						snake_case__	:      str     		=	d_model
						snake_case__	:      List[Any]     		=	encoder_attention_heads
						snake_case__	:      Tuple     		=	decoder_attention_heads
						snake_case__	:      Union[str, Any]     		=	encoder_ffn_dim
						snake_case__	:      Union[str, Any]     		=	decoder_ffn_dim
						snake_case__	:      List[str]     		=	encoder_layers
						snake_case__	:      List[str]     		=	decoder_layers

						snake_case__	:      List[Any]     		=	dropout
						snake_case__	:      Tuple     		=	attention_dropout
						snake_case__	:      Any     		=	activation_dropout
						snake_case__	:      List[Any]     		=	encoder_layerdrop
						snake_case__	:      Tuple     		=	decoder_layerdrop

						snake_case__	:      Dict     		=	activation_function
						snake_case__	:      Tuple     		=	init_std

						snake_case__	:      int     		=	use_cache

						# Informer
						snake_case__	:      Optional[Any]     		=	attention_type
						snake_case__	:      Optional[int]     		=	sampling_factor
						snake_case__	:      Dict     		=	distil

						super().__init__(is_encoder_decoder=__lowercase   ,**__lowercase  )






		@property
		def 	__lowerCamelCase			(     self     :Optional[int]  ):
						return (
						    sum(self.embedding_dimension  )
						    + self.num_dynamic_real_features
						    + self.num_time_features
						    + self.num_static_real_features
						    + self.input_size * 2  # the log1p(abs(loc)) and log(scale) features
						)






A__								=						[4, 1, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5]
A__								=						[3, 7, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5]
A__								=						{
    0: '''Sunday''',
    1: '''Monday''',
    2: '''Tuesday''',
    3: '''Wednesday''',
    4: '''Thursday''',
    5: '''Friday''',
    6: '''Saturday''',
}



def 			_lowerCAmelCase       (					__lowerCAmelCase  ,  __lowerCAmelCase  ,  __lowerCAmelCase      )   ->					str:


				"""simple docstring"""

				assert len(str(__lowerCAmelCase      )      ) > 2, "year should be in YYYY format"
				assert 1 <= month <= 12, "month should be between 1 to 12"
				assert 1 <= day <= 31, "day should be between 1 to 31"

				# Doomsday algorithm:
				snake_case__	:      Optional[int]     		=	year // 100
				snake_case__	:      List[str]     		=	(5 * (century % 4) + 2) % 7
				snake_case__	:      Dict     		=	year % 100
				snake_case__	:      Union[str, Any]     		=	centurian % 12
				snake_case__	:      List[Any]     		=	(
				    (centurian // 12) + centurian_m + (centurian_m // 4) + century_anchor
				) % 7
				snake_case__	:      List[str]     		=	(
				    DOOMSDAY_NOT_LEAP[month - 1]
				    if (year % 4 != 0) or (centurian == 0 and (year % 400) == 0)
				    else DOOMSDAY_LEAP[month - 1]
				)
				snake_case__	:      List[str]     		=	(dooms_day + day - day_anchor) % 7
				return WEEK_DAY_NAMES[week_day]


if __name__ == "__main__":
				import doctest

				doctest.testmod()

