from typing import List, Optional

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


_SCREAMING_SNAKE_CASE										=						logging.get_logger(__name__)

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



class 				a							(			_snake_case       ):







 """simple docstring"""






 lowerCamelCase	:Any    			=		"""autoformer"""
 lowerCamelCase	:Dict    			=		{
     """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_ = [1, 2, 3, 4, 5, 6, 7]		,				lowerCAmelCase_ = True		,				lowerCAmelCase_ = 0		,				lowerCAmelCase_ = 0		,				lowerCAmelCase_ = 0		,				lowerCAmelCase_ = 0		,				lowerCAmelCase_ = None		,				lowerCAmelCase_ = None		,				lowerCAmelCase_ = 64		,				lowerCAmelCase_ = 2		,				lowerCAmelCase_ = 2		,				lowerCAmelCase_ = 2		,				lowerCAmelCase_ = 2		,				lowerCAmelCase_ = 32		,				lowerCAmelCase_ = 32		,				lowerCAmelCase_ = "gelu"		,				lowerCAmelCase_ = 0.1		,				lowerCAmelCase_ = 0.1		,				lowerCAmelCase_ = 0.1		,				lowerCAmelCase_ = 0.1		,				lowerCAmelCase_ = 0.1		,				lowerCAmelCase_ = 1_00		,				lowerCAmelCase_ = 0.02		,				lowerCAmelCase_ = True		,				lowerCAmelCase_=True		,				lowerCAmelCase_ = 10		,				lowerCAmelCase_ = 25		,				lowerCAmelCase_ = 3		,				**lowerCAmelCase_		,				)  ->					List[Any]:
        # 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(__snake_case							) != 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(__snake_case							) != 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=__snake_case		,				**__snake_case							)



 @property
 def      UpperCAmelCase							(					self							)  ->					List[str]:
        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 ...configuration_utils import PretrainedConfig
from ...utils import logging


UpperCAmelCase_		:   Dict							   =		logging.get_logger(__name__)

UpperCAmelCase_		:   Optional[int]							   =		{
    'google/canine-s': 'https://huggingface.co/google/canine-s/resolve/main/config.json',
    # See all CANINE models at https://huggingface.co/models?filter=canine
}





class     lowercase__  (						_snake_case					):





							'''simple docstring'''


							A_							:      Optional[int]      	=  """canine"""






							def __init__(    self    ,					__snake_case=768    ,					__snake_case=12    ,					__snake_case=12    ,					__snake_case=3072    ,					__snake_case="gelu"    ,					__snake_case=0.1    ,					__snake_case=0.1    ,					__snake_case=1_6384    ,					__snake_case=16    ,					__snake_case=0.02    ,					__snake_case=1e-12    ,					__snake_case=0    ,					__snake_case=0XE000    ,					__snake_case=0XE001    ,					__snake_case=4    ,					__snake_case=4    ,					__snake_case=8    ,					__snake_case=1_6384    ,					__snake_case=128    ,					**__snake_case    ,					):
											super().__init__(pad_token_id=__snake_case    ,					bos_token_id=__snake_case    ,					eos_token_id=__snake_case    ,					**__snake_case  )

											_SCREAMING_SNAKE_CASE :       str     		=      max_position_embeddings
											_SCREAMING_SNAKE_CASE :       Any     		=      hidden_size
											_SCREAMING_SNAKE_CASE :       Dict     		=      num_hidden_layers
											_SCREAMING_SNAKE_CASE :       Tuple     		=      num_attention_heads
											_SCREAMING_SNAKE_CASE :       List[str]     		=      intermediate_size
											_SCREAMING_SNAKE_CASE :       Tuple     		=      hidden_act
											_SCREAMING_SNAKE_CASE :       Union[str, Any]     		=      hidden_dropout_prob
											_SCREAMING_SNAKE_CASE :       str     		=      attention_probs_dropout_prob
											_SCREAMING_SNAKE_CASE :       Dict     		=      initializer_range
											_SCREAMING_SNAKE_CASE :       Optional[int]     		=      type_vocab_size
											_SCREAMING_SNAKE_CASE :       Optional[Any]     		=      layer_norm_eps

											# Character config:
											_SCREAMING_SNAKE_CASE :       Any     		=      downsampling_rate
											_SCREAMING_SNAKE_CASE :       List[str]     		=      upsampling_kernel_size
											_SCREAMING_SNAKE_CASE :       Union[str, Any]     		=      num_hash_functions
											_SCREAMING_SNAKE_CASE :       Optional[Any]     		=      num_hash_buckets
											_SCREAMING_SNAKE_CASE :       Union[str, Any]     		=      local_transformer_stride




