


'''simple docstring'''






from typing import List, Optional, Union

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


a_   :      Optional[Any]				    =      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 	a       (       _SCREAMING_SNAKE_CASE    ):
 _lowerCAmelCase	   =		"""informer"""
 _lowerCAmelCase	   =		{
     """hidden_size""": """d_model""",
     """num_attention_heads""": """encoder_attention_heads""",
     """num_hidden_layers""": """encoder_layers""",
 }
 def __init__(	self ,			__magic_name__ = None ,			__magic_name__ = None ,			__magic_name__ = "student_t" ,			__magic_name__ = "nll" ,			__magic_name__ = 1 ,			__magic_name__ = None ,			__magic_name__ = "mean" ,			__magic_name__ = 0 ,			__magic_name__ = 0 ,			__magic_name__ = 0 ,			__magic_name__ = 0 ,			__magic_name__ = None ,			__magic_name__ = None ,			__magic_name__ = 64 ,			__magic_name__ = 32 ,			__magic_name__ = 32 ,			__magic_name__ = 2 ,			__magic_name__ = 2 ,			__magic_name__ = 2 ,			__magic_name__ = 2 ,			__magic_name__ = True ,			__magic_name__ = "gelu" ,			__magic_name__ = 0.0_5 ,			__magic_name__ = 0.1 ,			__magic_name__ = 0.1 ,			__magic_name__ = 0.1 ,			__magic_name__ = 0.1 ,			__magic_name__ = 1_00 ,			__magic_name__ = 0.0_2 ,			__magic_name__=True ,			__magic_name__ = "prob" ,			__magic_name__ = 5 ,			__magic_name__ = True ,			**__magic_name__ ,			)   ->							str:
      # time series specific configuration
      _a      =							prediction_length
      _a      =							context_length or prediction_length
      _a      =							distribution_output
      _a      =							loss
      _a      =							input_size
      _a      =							num_time_features
      _a      =							lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
      _a      =							scaling
      _a      =							num_dynamic_real_features
      _a      =							num_static_real_features
      _a      =							num_static_categorical_features

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

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

      _a      =							num_parallel_samples

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

      _a      =							dropout
      _a      =							attention_dropout
      _a      =							activation_dropout
      _a      =							encoder_layerdrop
      _a      =							decoder_layerdrop

      _a      =							activation_function
      _a      =							init_std

      _a      =							use_cache

      # Informer
      _a      =							attention_type
      _a      =							sampling_factor
      _a      =							distil

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




 @property
 def 							__UpperCAmelCase						(	self  )   ->							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'''






from typing import TYPE_CHECKING

from ...file_utils import _LazyModule, is_tokenizers_available, is_torch_available
from ...utils import OptionalDependencyNotAvailable


a_   :      List[Any]				    =      {"configuration_gpt_neox": ["GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTNeoXConfig"]}

try:
 if not is_tokenizers_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a_   :      List[str]				    =      ["GPTNeoXTokenizerFast"]

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a_   :      List[Any]				    =      [
     "GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST",
     "GPTNeoXForCausalLM",
     "GPTNeoXForQuestionAnswering",
     "GPTNeoXForSequenceClassification",
     "GPTNeoXForTokenClassification",
     "GPTNeoXLayer",
     "GPTNeoXModel",
     "GPTNeoXPreTrainedModel",
 ]


if TYPE_CHECKING:
 from .configuration_gpt_neox import GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoXConfig

 try:
  if not is_tokenizers_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_gpt_neox_fast import GPTNeoXTokenizerFast

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_gpt_neox import (
      GPT_NEOX_PRETRAINED_MODEL_ARCHIVE_LIST,
      GPTNeoXForCausalLM,
      GPTNeoXForQuestionAnswering,
      GPTNeoXForSequenceClassification,
      GPTNeoXForTokenClassification,
      GPTNeoXLayer,
      GPTNeoXModel,
      GPTNeoXPreTrainedModel,
  )


else:
 import sys

 a_   :      Optional[Any]				    =      _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)

