


from typing import List, Optional, Union

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


SCREAMING_SNAKE_CASE :   int							      =				logging.get_logger(__name__)

SCREAMING_SNAKE_CASE :   Union[str, Any]							      =				{
    '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 _lowerCamelCase(		a__     ):
       lowercase_				:			Optional[Any]									=    """informer"""
       lowercase_				:			Optional[Any]									=    {
           """hidden_size""": """d_model""",
           """num_attention_heads""": """encoder_attention_heads""",
           """num_hidden_layers""": """encoder_layers""",
       }
       def __init__(      self,   lowerCamelCase = None,   lowerCamelCase = None,   lowerCamelCase = "student_t",   lowerCamelCase = "nll",   lowerCamelCase = 1,   lowerCamelCase = None,   lowerCamelCase = "mean",   lowerCamelCase = 0,   lowerCamelCase = 0,   lowerCamelCase = 0,   lowerCamelCase = 0,   lowerCamelCase = None,   lowerCamelCase = None,   lowerCamelCase = 64,   lowerCamelCase = 32,   lowerCamelCase = 32,   lowerCamelCase = 2,   lowerCamelCase = 2,   lowerCamelCase = 2,   lowerCamelCase = 2,   lowerCamelCase = True,   lowerCamelCase = "gelu",   lowerCamelCase = 0.0_5,   lowerCamelCase = 0.1,   lowerCamelCase = 0.1,   lowerCamelCase = 0.1,   lowerCamelCase = 0.1,   lowerCamelCase = 1_00,   lowerCamelCase = 0.0_2,   lowerCamelCase=True,   lowerCamelCase = "prob",   lowerCamelCase = 5,   lowerCamelCase = True,   **lowerCamelCase,   ) ->     List[str]:




           """simple docstring"""

           _lowercase :							List[str]   	=	prediction_length
           _lowercase :							Any   	=	context_length or prediction_length
           _lowercase :							Any   	=	distribution_output
           _lowercase :							Tuple   	=	loss
           _lowercase :							Dict   	=	input_size
           _lowercase :							List[Any]   	=	num_time_features
           _lowercase :							Tuple   	=	lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
           _lowercase :							str   	=	scaling
           _lowercase :							Optional[Any]   	=	num_dynamic_real_features
           _lowercase :							Dict   	=	num_static_real_features
           _lowercase :							List[str]   	=	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`')
               _lowercase :							Union[str, Any]   	=	cardinality
           else:
               _lowercase :							int   	=	[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`')
               _lowercase :							List[Any]   	=	embedding_dimension
           else:
               _lowercase :							List[str]   	=	[min(50,   (cat + 1) // 2) for cat in self.cardinality]

           _lowercase :							Optional[Any]   	=	num_parallel_samples

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

           _lowercase :							Dict   	=	dropout
           _lowercase :							List[str]   	=	attention_dropout
           _lowercase :							Optional[int]   	=	activation_dropout
           _lowercase :							List[Any]   	=	encoder_layerdrop
           _lowercase :							Union[str, Any]   	=	decoder_layerdrop

           _lowercase :							Tuple   	=	activation_function
           _lowercase :							Union[str, Any]   	=	init_std

           _lowercase :							Union[str, Any]   	=	use_cache

           # Informer
           _lowercase :							List[Any]   	=	attention_type
           _lowercase :							Optional[int]   	=	sampling_factor
           _lowercase :							Tuple   	=	distil

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




       @property
       def     UpperCamelCase  (      self) ->     int:




           """simple docstring"""

           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
           )






def        UpperCamelCase_(   lowerCamelCase_				)					->		int:
    assert (
        isinstance(lowerCamelCase_							,				lowerCamelCase_				) and number_of_steps > 0
    ), F'''number_of_steps needs to be positive integer, your input {number_of_steps}'''
    if number_of_steps == 1:
        return 1
    _lowercase	,       _lowercase :							Dict   	=	1, 1
    for _ in range(number_of_steps - 1				):
        _lowercase	,       _lowercase :							Tuple   	=	current + previous, current
    return current


if __name__ == "__main__":
 import doctest

 doctest.testmod()


