





'''simple docstring'''

from typing import List, Optional

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


a   	=    logging.get_logger(__name__)

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







class __a			( _snake_case      ):
   __UpperCamelCase :			Optional[int]						   =						'autoformer'
   __UpperCamelCase :			int						   =						{
       'hidden_size': 'd_model',
       'num_attention_heads': 'encoder_attention_heads',
       'num_hidden_layers': 'encoder_layers',
   }





   def __init__(       self					:      Optional[int]					,lowerCamelCase					:      Optional[int] = None					,lowerCamelCase					:      Optional[int] = None					,lowerCamelCase					:      str = "student_t"					,lowerCamelCase					:      str = "nll"					,lowerCamelCase					:      int = 1					,lowerCamelCase					:      List[int] = [1, 2, 3, 4, 5, 6, 7]					,lowerCamelCase					:      bool = True					,lowerCamelCase					:      int = 0					,lowerCamelCase					:      int = 0					,lowerCamelCase					:      int = 0					,lowerCamelCase					:      int = 0					,lowerCamelCase					:      Optional[List[int]] = None					,lowerCamelCase					:      Optional[List[int]] = None					,lowerCamelCase					:      int = 64					,lowerCamelCase					:      int = 2					,lowerCamelCase					:      int = 2					,lowerCamelCase					:      int = 2					,lowerCamelCase					:      int = 2					,lowerCamelCase					:      int = 32					,lowerCamelCase					:      int = 32					,lowerCamelCase					:      str = "gelu"					,lowerCamelCase					:      float = 0.1					,lowerCamelCase					:      float = 0.1					,lowerCamelCase					:      float = 0.1					,lowerCamelCase					:      float = 0.1					,lowerCamelCase					:      float = 0.1					,lowerCamelCase					:      int = 100					,lowerCamelCase					:      float = 0.02					,lowerCamelCase					:      bool = True					,lowerCamelCase					:      str=True					,lowerCamelCase					:      int = 10					,lowerCamelCase					:      int = 25					,lowerCamelCase					:      int = 3					,**lowerCamelCase					:      Dict					,):

      '''simple docstring'''

      __SCREAMING_SNAKE_CASE   				=							prediction_length
      __SCREAMING_SNAKE_CASE   				=							context_length if context_length is not None else prediction_length
      __SCREAMING_SNAKE_CASE   				=							distribution_output
      __SCREAMING_SNAKE_CASE   				=							loss
      __SCREAMING_SNAKE_CASE   				=							input_size
      __SCREAMING_SNAKE_CASE   				=							num_time_features
      __SCREAMING_SNAKE_CASE   				=							lags_sequence
      __SCREAMING_SNAKE_CASE   				=							scaling
      __SCREAMING_SNAKE_CASE   				=							num_dynamic_real_features
      __SCREAMING_SNAKE_CASE   				=							num_static_real_features
      __SCREAMING_SNAKE_CASE   				=							num_static_categorical_features
      if cardinality is not None and num_static_categorical_features > 0:
         if len(lowerCamelCase     ) != num_static_categorical_features:
            raise ValueError(
                """The cardinality should be a list of the same length as `num_static_categorical_features`"""     )
         __SCREAMING_SNAKE_CASE   				=							cardinality
      else:
         __SCREAMING_SNAKE_CASE   				=							[0]
      if embedding_dimension is not None and num_static_categorical_features > 0:
         if len(lowerCamelCase     ) != num_static_categorical_features:
            raise ValueError(
                """The embedding dimension should be a list of the same length as `num_static_categorical_features`"""     )
         __SCREAMING_SNAKE_CASE   				=							embedding_dimension
      else:
         __SCREAMING_SNAKE_CASE   				=							[min(50					,(cat + 1) // 2     ) for cat in self.cardinality]
      __SCREAMING_SNAKE_CASE   				=							num_parallel_samples

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

      __SCREAMING_SNAKE_CASE   				=							dropout
      __SCREAMING_SNAKE_CASE   				=							attention_dropout
      __SCREAMING_SNAKE_CASE   				=							activation_dropout
      __SCREAMING_SNAKE_CASE   				=							encoder_layerdrop
      __SCREAMING_SNAKE_CASE   				=							decoder_layerdrop

      __SCREAMING_SNAKE_CASE   				=							activation_function
      __SCREAMING_SNAKE_CASE   				=							init_std

      __SCREAMING_SNAKE_CASE   				=							use_cache

      # Autoformer
      __SCREAMING_SNAKE_CASE   				=							label_length
      __SCREAMING_SNAKE_CASE   				=							moving_average
      __SCREAMING_SNAKE_CASE   				=							autocorrelation_factor

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





   @property
   def   UpperCAmelCase__  (       self					:      List[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
      )









from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


SCREAMING_SNAKE_CASE							    =							{'configuration_wavlm': ['WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP', 'WavLMConfig']}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  SCREAMING_SNAKE_CASE							    =							[
      'WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST',
      'WavLMForAudioFrameClassification',
      'WavLMForCTC',
      'WavLMForSequenceClassification',
      'WavLMForXVector',
      'WavLMModel',
      'WavLMPreTrainedModel',
  ]

if TYPE_CHECKING:
  from .configuration_wavlm import WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP, WavLMConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_wavlm import (
        WAVLM_PRETRAINED_MODEL_ARCHIVE_LIST,
        WavLMForAudioFrameClassification,
        WavLMForCTC,
        WavLMForSequenceClassification,
        WavLMForXVector,
        WavLMModel,
        WavLMPreTrainedModel,
    )

else:
  import sys

  SCREAMING_SNAKE_CASE							    =							_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)



