'''simple docstring'''





from typing import List, Optional, Union

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


UpperCAmelCase_			    =							logging.get_logger(__name__)

UpperCAmelCase_			    =							{
    '''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  __magic_name__  (		__a    ):





   """simple docstring"""




   lowerCAmelCase      :    List[Any]  			=   '''informer'''
   lowerCAmelCase      :    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 = 64		,  _lowercase					:  int = 32		,  _lowercase					:  int = 32		,  _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 = 100		,  _lowercase					:  float = 0.02		,  _lowercase					:  Union[str, Any]=True		,  _lowercase					:  str = "prob"		,  _lowercase					:  int = 5		,  _lowercase					:  bool = True		,  **_lowercase					:  Optional[int]		,  ):



    """simple docstring"""



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

    _UpperCamelCase:     Tuple							= num_parallel_samples

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

    _UpperCamelCase:     List[str]							= dropout
    _UpperCamelCase:     Optional[int]							= attention_dropout
    _UpperCamelCase:     int							= activation_dropout
    _UpperCamelCase:     Any							= encoder_layerdrop
    _UpperCamelCase:     List[Any]							= decoder_layerdrop

    _UpperCamelCase:     Optional[Any]							= activation_function
    _UpperCamelCase:     List[str]							= init_std

    _UpperCamelCase:     List[Any]							= use_cache

    # Informer
    _UpperCamelCase:     Optional[int]							= attention_type
    _UpperCamelCase:     Union[str, Any]							= sampling_factor
    _UpperCamelCase:     Optional[int]							= distil

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



   @property
   def   lowerCAmelCase						(	self					:  str							):



    """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
    )
import warnings

from ..trainer import Trainer
from ..utils import logging


UpperCAmelCase_			    =							logging.get_logger(__name__)




class  __magic_name__  (		__a    ):





   """simple docstring"""




   def __init__(	self					:  List[Any]		,  _lowercase					:  int=None		,  **_lowercase					:  Optional[Any]							):



    """simple docstring"""



    warnings.warn(
        '''`SageMakerTrainer` is deprecated and will be removed in v5 of Transformers. You can use `Trainer` '''
        '''instead.'''		,  _lowercase		,  )
    super().__init__(args=_lowercase		,  **_lowercase							)