




'''simple docstring'''


from typing import List, Optional

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


UpperCAmelCase_					=   logging.get_logger(__name__)

UpperCAmelCase_					=   {
    "huggingface/autoformer-tourism-monthly": "https://huggingface.co/huggingface/autoformer-tourism-monthly/resolve/main/config.json",
}





class  __lowercase    (	__magic_name__			):
   _a    						=   """autoformer"""
   _a    						=   {
       """hidden_size""": """d_model""",
       """num_attention_heads""": """encoder_attention_heads""",
       """num_hidden_layers""": """encoder_layers""",
   }







   def __init__(						self   ,				UpperCamelCase = None   ,				UpperCamelCase = None   ,				UpperCamelCase = "student_t"   ,				UpperCamelCase = "nll"   ,				UpperCamelCase = 1   ,				UpperCamelCase = [1, 2, 3, 4, 5, 6, 7]   ,				UpperCamelCase = True   ,				UpperCamelCase = 0   ,				UpperCamelCase = 0   ,				UpperCamelCase = 0   ,				UpperCamelCase = 0   ,				UpperCamelCase = None   ,				UpperCamelCase = None   ,				UpperCamelCase = 64   ,				UpperCamelCase = 2   ,				UpperCamelCase = 2   ,				UpperCamelCase = 2   ,				UpperCamelCase = 2   ,				UpperCamelCase = 32   ,				UpperCamelCase = 32   ,				UpperCamelCase = "gelu"   ,				UpperCamelCase = 0.1   ,				UpperCamelCase = 0.1   ,				UpperCamelCase = 0.1   ,				UpperCamelCase = 0.1   ,				UpperCamelCase = 0.1   ,				UpperCamelCase = 100   ,				UpperCamelCase = 0.02   ,				UpperCamelCase = True   ,				UpperCamelCase=True   ,				UpperCamelCase = 10   ,				UpperCamelCase = 25   ,				UpperCamelCase = 3   ,				**UpperCamelCase   ,				)					->     Dict:
     # time series specific configuration
     __a								=       prediction_length
     __a								=       context_length if context_length is not None else prediction_length
     __a								=       distribution_output
     __a								=       loss
     __a								=       input_size
     __a								=       num_time_features
     __a								=       lags_sequence
     __a								=       scaling
     __a								=       num_dynamic_real_features
     __a								=       num_static_real_features
     __a								=       num_static_categorical_features
     if cardinality is not None and num_static_categorical_features > 0:
       if len(UpperCamelCase   ) != 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]
     if embedding_dimension is not None and num_static_categorical_features > 0:
       if len(UpperCamelCase   ) != 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

     # Autoformer
     __a								=       label_length
     __a								=       moving_average
     __a								=       autocorrelation_factor

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







   @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 ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


UpperCAmelCase_					=   {"configuration_swin": ["SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP", "SwinConfig", "SwinOnnxConfig"]}


try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase_					=   [
      "SWIN_PRETRAINED_MODEL_ARCHIVE_LIST",
      "SwinForImageClassification",
      "SwinForMaskedImageModeling",
      "SwinModel",
      "SwinPreTrainedModel",
      "SwinBackbone",
  ]

try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase_					=   [
      "TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST",
      "TFSwinForImageClassification",
      "TFSwinForMaskedImageModeling",
      "TFSwinModel",
      "TFSwinPreTrainedModel",
  ]

if TYPE_CHECKING:
  from .configuration_swin import SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, SwinConfig, SwinOnnxConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_swin import (
        SWIN_PRETRAINED_MODEL_ARCHIVE_LIST,
        SwinBackbone,
        SwinForImageClassification,
        SwinForMaskedImageModeling,
        SwinModel,
        SwinPreTrainedModel,
    )

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_swin import (
        TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST,
        TFSwinForImageClassification,
        TFSwinForMaskedImageModeling,
        TFSwinModel,
        TFSwinPreTrainedModel,
    )

else:
  import sys

  UpperCAmelCase_					=   _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)



