



from typing import List, Optional, Union

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


snake_case_    					=	logging.get_logger(__name__)

snake_case_    					=	{
    """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_      (					SCREAMING_SNAKE_CASE_    ):



						"""simple docstring"""
						__UpperCamelCase		    =							"""informer"""
						__UpperCamelCase		    =							{
						    """hidden_size""": """d_model""",
						    """num_attention_heads""": """encoder_attention_heads""",
						    """num_hidden_layers""": """encoder_layers""",
						}






						def __init__( self			:List[Any]       ,  lowercase_			:Optional[Any] = None       ,  lowercase_			:Any = None       ,  lowercase_			:Tuple = "student_t"       ,  lowercase_			:Dict = "nll"       ,  lowercase_			:Union[str, Any] = 1       ,  lowercase_			:List[Any] = None       ,  lowercase_			:Optional[int] = "mean"       ,  lowercase_			:int = 0       ,  lowercase_			:List[Any] = 0       ,  lowercase_			:List[Any] = 0       ,  lowercase_			:List[Any] = 0       ,  lowercase_			:Optional[Any] = None       ,  lowercase_			:Union[str, Any] = None       ,  lowercase_			:List[Any] = 64       ,  lowercase_			:Union[str, Any] = 32       ,  lowercase_			:Optional[int] = 32       ,  lowercase_			:Any = 2       ,  lowercase_			:str = 2       ,  lowercase_			:Optional[int] = 2       ,  lowercase_			:str = 2       ,  lowercase_			:Tuple = True       ,  lowercase_			:Optional[int] = "gelu"       ,  lowercase_			:Dict = 0.05       ,  lowercase_			:Optional[Any] = 0.1       ,  lowercase_			:Any = 0.1       ,  lowercase_			:int = 0.1       ,  lowercase_			:List[str] = 0.1       ,  lowercase_			:Optional[Any] = 1_00       ,  lowercase_			:Any = 0.02       ,  lowercase_			:List[str]=True       ,  lowercase_			:str = "prob"       ,  lowercase_			:Optional[Any] = 5       ,  lowercase_			:Any = True       ,  **lowercase_			:str       ,  )    ->      Dict:
												UpperCAmelCase					=			prediction_length
												UpperCAmelCase					=			context_length or prediction_length
												UpperCAmelCase					=			distribution_output
												UpperCAmelCase					=			loss
												UpperCAmelCase					=			input_size
												UpperCAmelCase					=			num_time_features
												UpperCAmelCase					=			lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
												UpperCAmelCase					=			scaling
												UpperCAmelCase					=			num_dynamic_real_features
												UpperCAmelCase					=			num_static_real_features
												UpperCAmelCase					=			num_static_categorical_features

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

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

												UpperCAmelCase					=			num_parallel_samples

												# Transformer architecture configuration
												UpperCAmelCase					=			input_size * len(self.lags_sequence ) + self._number_of_features
												UpperCAmelCase					=			d_model
												UpperCAmelCase					=			encoder_attention_heads
												UpperCAmelCase					=			decoder_attention_heads
												UpperCAmelCase					=			encoder_ffn_dim
												UpperCAmelCase					=			decoder_ffn_dim
												UpperCAmelCase					=			encoder_layers
												UpperCAmelCase					=			decoder_layers

												UpperCAmelCase					=			dropout
												UpperCAmelCase					=			attention_dropout
												UpperCAmelCase					=			activation_dropout
												UpperCAmelCase					=			encoder_layerdrop
												UpperCAmelCase					=			decoder_layerdrop

												UpperCAmelCase					=			activation_function
												UpperCAmelCase					=			init_std

												UpperCAmelCase					=			use_cache

												# Informer
												UpperCAmelCase					=			attention_type
												UpperCAmelCase					=			sampling_factor
												UpperCAmelCase					=			distil

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






						@property
						def      UpperCAmelCase__					( self			:Any )    ->      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
												)










"""simple docstring"""


def 			_lowerCAmelCase				(       ):
						for n in range(1		,     1000000						):
												yield n * (n + 1) // 2

def 			_lowerCAmelCase				(       lowercase_						):
						UpperCAmelCase					=			1
						UpperCAmelCase					=			2
						while i * i <= n:
												UpperCAmelCase					=			0
												while n % i == 0:
																		n //= i
																		multiplicity += 1
												divisors_count *= multiplicity + 1
												i += 1
						if n > 1:
												divisors_count *= 2
						return divisors_count

def 			_lowerCAmelCase				(       ):
						return next(i for i in triangle_number_generator() if count_divisors(lowercase_						) > 500						)


if __name__ == "__main__":
				print(solution())





