
from typing import List, Optional

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


lowerCamelCase_  :	Dict 				=					logging.get_logger(__name__)

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

class     _UpperCamelCase			(   _A					):






			'''simple docstring'''

			__UpperCamelCase :  Optional[int]    =	"""autoformer"""
			__UpperCamelCase :  Optional[int]    =	{
			    """hidden_size""": """d_model""",
			    """num_attention_heads""": """encoder_attention_heads""",
			    """num_hidden_layers""": """encoder_layers""",
			}

			def __init__(    self	:    List[str]  ,		snake_case_	:    Optional[int] = None  ,		snake_case_	:    Optional[int] = None  ,		snake_case_	:    str = "student_t"  ,		snake_case_	:    str = "nll"  ,		snake_case_	:    int = 1  ,		snake_case_	:    List[int] = [1, 2, 3, 4, 5, 6, 7]  ,		snake_case_	:    bool = True  ,		snake_case_	:    int = 0  ,		snake_case_	:    int = 0  ,		snake_case_	:    int = 0  ,		snake_case_	:    int = 0  ,		snake_case_	:    Optional[List[int]] = None  ,		snake_case_	:    Optional[List[int]] = None  ,		snake_case_	:    int = 64  ,		snake_case_	:    int = 2  ,		snake_case_	:    int = 2  ,		snake_case_	:    int = 2  ,		snake_case_	:    int = 2  ,		snake_case_	:    int = 32  ,		snake_case_	:    int = 32  ,		snake_case_	:    str = "gelu"  ,		snake_case_	:    float = 0.1  ,		snake_case_	:    float = 0.1  ,		snake_case_	:    float = 0.1  ,		snake_case_	:    float = 0.1  ,		snake_case_	:    float = 0.1  ,		snake_case_	:    int = 100  ,		snake_case_	:    float = 0.02  ,		snake_case_	:    bool = True  ,		snake_case_	:    Any=True  ,		snake_case_	:    int = 10  ,		snake_case_	:    int = 25  ,		snake_case_	:    int = 3  ,		**snake_case_	:    Optional[Any]  ,		):
							# time series specific configuration
							UpperCamelCase_:							List[str]		=  prediction_length
							UpperCamelCase_:							Dict		=  context_length if context_length is not None else prediction_length
							UpperCamelCase_:							List[str]		=  distribution_output
							UpperCamelCase_:							List[Any]		=  loss
							UpperCamelCase_:							Tuple		=  input_size
							UpperCamelCase_:							Dict		=  num_time_features
							UpperCamelCase_:							Dict		=  lags_sequence
							UpperCamelCase_:							Optional[int]		=  scaling
							UpperCamelCase_:							Optional[Any]		=  num_dynamic_real_features
							UpperCamelCase_:							Optional[Any]		=  num_static_real_features
							UpperCamelCase_:							str		=  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`""" )
											UpperCamelCase_:							Optional[Any]		=  cardinality
							else:
											UpperCamelCase_:							Dict		=  [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`""" )
											UpperCamelCase_:							Tuple		=  embedding_dimension
							else:
											UpperCamelCase_:							Dict		=  [min(50  ,		(cat + 1) // 2 ) for cat in self.cardinality]
							UpperCamelCase_:							str		=  num_parallel_samples

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

							UpperCamelCase_:							List[Any]		=  dropout
							UpperCamelCase_:							List[Any]		=  attention_dropout
							UpperCamelCase_:							Union[str, Any]		=  activation_dropout
							UpperCamelCase_:							Optional[int]		=  encoder_layerdrop
							UpperCamelCase_:							Any		=  decoder_layerdrop

							UpperCamelCase_:							str		=  activation_function
							UpperCamelCase_:							Optional[int]		=  init_std

							UpperCamelCase_:							List[Any]		=  use_cache

							# Autoformer
							UpperCamelCase_:							Optional[Any]		=  label_length
							UpperCamelCase_:							Optional[int]		=  moving_average
							UpperCamelCase_:							int		=  autocorrelation_factor

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




			@property
			def  lowerCAmelCase__		(    self	:    Dict ):
							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 ...configuration_utils import PretrainedConfig
from ...utils import logging


lowerCamelCase_  :	Optional[int] 				=					logging.get_logger(__name__)

lowerCamelCase_  :	Dict 				=					{
    """studio-ousia/luke-base""": """https://huggingface.co/studio-ousia/luke-base/resolve/main/config.json""",
    """studio-ousia/luke-large""": """https://huggingface.co/studio-ousia/luke-large/resolve/main/config.json""",
}

class     _UpperCamelCase			(   _A					):






			'''simple docstring'''

			__UpperCamelCase :  Optional[int]    =	"""luke"""

			def __init__(    self	:    Tuple  ,		snake_case_	:    List[Any]=5_0267  ,		snake_case_	:    Any=50_0000  ,		snake_case_	:    str=768  ,		snake_case_	:    int=256  ,		snake_case_	:    str=12  ,		snake_case_	:    int=12  ,		snake_case_	:    Dict=3072  ,		snake_case_	:    Optional[Any]="gelu"  ,		snake_case_	:    Dict=0.1  ,		snake_case_	:    List[str]=0.1  ,		snake_case_	:    int=512  ,		snake_case_	:    Dict=2  ,		snake_case_	:    List[Any]=0.02  ,		snake_case_	:    int=1e-12  ,		snake_case_	:    Union[str, Any]=True  ,		snake_case_	:    Union[str, Any]=None  ,		snake_case_	:    Dict=1  ,		snake_case_	:    Optional[int]=0  ,		snake_case_	:    List[str]=2  ,		**snake_case_	:    Union[str, Any]  ,		):
							super().__init__(pad_token_id=snake_case_  ,		bos_token_id=snake_case_  ,		eos_token_id=snake_case_  ,		**snake_case_ )

							UpperCamelCase_:							Dict		=  vocab_size
							UpperCamelCase_:							Tuple		=  entity_vocab_size
							UpperCamelCase_:							Optional[int]		=  hidden_size
							UpperCamelCase_:							Any		=  entity_emb_size
							UpperCamelCase_:							str		=  num_hidden_layers
							UpperCamelCase_:							Union[str, Any]		=  num_attention_heads
							UpperCamelCase_:							Dict		=  hidden_act
							UpperCamelCase_:							Dict		=  intermediate_size
							UpperCamelCase_:							str		=  hidden_dropout_prob
							UpperCamelCase_:							List[str]		=  attention_probs_dropout_prob
							UpperCamelCase_:							int		=  max_position_embeddings
							UpperCamelCase_:							int		=  type_vocab_size
							UpperCamelCase_:							List[Any]		=  initializer_range
							UpperCamelCase_:							Union[str, Any]		=  layer_norm_eps
							UpperCamelCase_:							Tuple		=  use_entity_aware_attention
							UpperCamelCase_:							int		=  classifier_dropout






