






from typing import List, Optional, Union

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


A_		:		Optional[int]		     =			logging.get_logger(__name__)

A_		:		Dict		     =			{
    '''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_ ):





       """simple docstring"""







       a    :		Tuple									='''informer'''
       a    :		Tuple									={
           '''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 = 6_4  ,      _lowerCamelCase = 3_2  ,      _lowerCamelCase = 3_2  ,      _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_0_0  ,      _lowerCamelCase = 0.0_2  ,      _lowerCamelCase=True  ,      _lowerCamelCase = "prob"  ,      _lowerCamelCase = 5  ,      _lowerCamelCase = True  ,      **_lowerCamelCase  ,      ):
        # time series specific configuration
        UpperCamelCase_: Union[str, Any]   				=    prediction_length
        UpperCamelCase_: str   				=    context_length or prediction_length
        UpperCamelCase_: Any   				=    distribution_output
        UpperCamelCase_: Optional[int]   				=    loss
        UpperCamelCase_: Optional[int]   				=    input_size
        UpperCamelCase_: str   				=    num_time_features
        UpperCamelCase_: Dict   				=    lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
        UpperCamelCase_: Dict   				=    scaling
        UpperCamelCase_: str   				=    num_dynamic_real_features
        UpperCamelCase_: List[str]   				=    num_static_real_features
        UpperCamelCase_: 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`'							)
         UpperCamelCase_: List[Any]   				=    cardinality
        else:
         UpperCamelCase_: str   				=    [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`'							)
         UpperCamelCase_: List[str]   				=    embedding_dimension
        else:
         UpperCamelCase_: Any   				=    [min(5_0  ,      (cat + 1) // 2							) for cat in self.cardinality]

        UpperCamelCase_: List[Any]   				=    num_parallel_samples

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

        UpperCamelCase_: Any   				=    dropout
        UpperCamelCase_: List[Any]   				=    attention_dropout
        UpperCamelCase_: List[Any]   				=    activation_dropout
        UpperCamelCase_: List[Any]   				=    encoder_layerdrop
        UpperCamelCase_: List[str]   				=    decoder_layerdrop

        UpperCamelCase_: Union[str, Any]   				=    activation_function
        UpperCamelCase_: int   				=    init_std

        UpperCamelCase_: List[Any]   				=    use_cache

        # Informer
        UpperCamelCase_: Any   				=    attention_type
        UpperCamelCase_: int   				=    sampling_factor
        UpperCamelCase_: Dict   				=    distil

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





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







from abc import ABC, abstractmethod
from argparse import ArgumentParser




class     _lowerCAmelCase(	UpperCAmelCase_ ):





       """simple docstring"""







       @staticmethod
       @abstractmethod
       def       _a   ( _lowerCamelCase							):
         raise NotImplementedError()





       @abstractmethod
       def       _a   ( self							):
         raise NotImplementedError()