


from typing import List, Optional, Union

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


lowerCAmelCase			=				logging.get_logger(__name__)

lowerCAmelCase			=				{
    '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				(     UpperCamelCase__     ):
							_lowercase      :     Union[str, Any]     =					'''informer'''
							_lowercase      :     int     =					{
							    '''hidden_size''': '''d_model''',
							    '''num_attention_heads''': '''encoder_attention_heads''',
							    '''num_hidden_layers''': '''encoder_layers''',
							}

							def __init__(				self:      Dict       ,		UpperCamelCase_:      Optional[int] = None       ,		UpperCamelCase_:      Optional[int] = None       ,		UpperCamelCase_:      str = "student_t"       ,		UpperCamelCase_:      str = "nll"       ,		UpperCamelCase_:      int = 1       ,		UpperCamelCase_:      List[int] = None       ,		UpperCamelCase_:      Optional[Union[str, bool]] = "mean"       ,		UpperCamelCase_:      int = 0       ,		UpperCamelCase_:      int = 0       ,		UpperCamelCase_:      int = 0       ,		UpperCamelCase_:      int = 0       ,		UpperCamelCase_:      Optional[List[int]] = None       ,		UpperCamelCase_:      Optional[List[int]] = None       ,		UpperCamelCase_:      int = 64       ,		UpperCamelCase_:      int = 32       ,		UpperCamelCase_:      int = 32       ,		UpperCamelCase_:      int = 2       ,		UpperCamelCase_:      int = 2       ,		UpperCamelCase_:      int = 2       ,		UpperCamelCase_:      int = 2       ,		UpperCamelCase_:      bool = True       ,		UpperCamelCase_:      str = "gelu"       ,		UpperCamelCase_:      float = 0.05       ,		UpperCamelCase_:      float = 0.1       ,		UpperCamelCase_:      float = 0.1       ,		UpperCamelCase_:      float = 0.1       ,		UpperCamelCase_:      float = 0.1       ,		UpperCamelCase_:      int = 100       ,		UpperCamelCase_:      float = 0.02       ,		UpperCamelCase_:      Tuple=True       ,		UpperCamelCase_:      str = "prob"       ,		UpperCamelCase_:      int = 5       ,		UpperCamelCase_:      bool = True       ,		**UpperCamelCase_:      Optional[int]       ,		)     ->  Union[str, Any]:





									"""simple docstring"""







									lowercase__				= prediction_length
									lowercase__				= context_length or prediction_length
									lowercase__				= distribution_output
									lowercase__				= loss
									lowercase__				= input_size
									lowercase__				= num_time_features
									lowercase__				= lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
									lowercase__				= scaling
									lowercase__				= num_dynamic_real_features
									lowercase__				= num_static_real_features
									lowercase__				= num_static_categorical_features

									# set cardinality
									if cardinality 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`'''				)
											lowercase__				= cardinality
									else:
											lowercase__				= [0]

									# set embedding_dimension
									if embedding_dimension 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`'''				)
											lowercase__				= embedding_dimension
									else:
											lowercase__				= [min(50       ,		(cat + 1) // 2				) for cat in self.cardinality]

									lowercase__				= num_parallel_samples

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

									lowercase__				= dropout
									lowercase__				= attention_dropout
									lowercase__				= activation_dropout
									lowercase__				= encoder_layerdrop
									lowercase__				= decoder_layerdrop

									lowercase__				= activation_function
									lowercase__				= init_std

									lowercase__				= use_cache

									# Informer
									lowercase__				= attention_type
									lowercase__				= sampling_factor
									lowercase__				= distil

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


							@property
							def  lowerCamelCase_					(				self:      Any				)     ->  int:





									"""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
									)




"""simple docstring"""






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


UpperCAmelCase        =				logging.get_logger(__name__)

UpperCAmelCase        =				{"""openai-gpt""": """https://huggingface.co/openai-gpt/resolve/main/config.json"""}



class 			lowercase					( lowercase__		):
			lowercase        =     '''openai-gpt'''
			lowercase        =     {
			    '''max_position_embeddings''': '''n_positions''',
			    '''hidden_size''': '''n_embd''',
			    '''num_attention_heads''': '''n_head''',
			    '''num_hidden_layers''': '''n_layer''',
			}






			def __init__(self  :	List[Any]      ,SCREAMING_SNAKE_CASE_  :	str=40_478      ,SCREAMING_SNAKE_CASE_  :	Optional[int]=512      ,SCREAMING_SNAKE_CASE_  :	Union[str, Any]=768      ,SCREAMING_SNAKE_CASE_  :	Dict=12      ,SCREAMING_SNAKE_CASE_  :	Dict=12      ,SCREAMING_SNAKE_CASE_  :	int="gelu"      ,SCREAMING_SNAKE_CASE_  :	Dict=0.1      ,SCREAMING_SNAKE_CASE_  :	List[Any]=0.1      ,SCREAMING_SNAKE_CASE_  :	Dict=0.1      ,SCREAMING_SNAKE_CASE_  :	Optional[Any]=1e-5      ,SCREAMING_SNAKE_CASE_  :	List[str]=0.02      ,SCREAMING_SNAKE_CASE_  :	Union[str, Any]="cls_index"      ,SCREAMING_SNAKE_CASE_  :	str=True      ,SCREAMING_SNAKE_CASE_  :	Any=None      ,SCREAMING_SNAKE_CASE_  :	List[Any]=True      ,SCREAMING_SNAKE_CASE_  :	List[str]=0.1      ,**SCREAMING_SNAKE_CASE_  :	int      ,)       ->	int:





				"""simple docstring"""


				lowerCAmelCase												=  vocab_size
				lowerCAmelCase												=  n_positions
				lowerCAmelCase												=  n_embd
				lowerCAmelCase												=  n_layer
				lowerCAmelCase												=  n_head
				lowerCAmelCase												=  afn
				lowerCAmelCase												=  resid_pdrop
				lowerCAmelCase												=  embd_pdrop
				lowerCAmelCase												=  attn_pdrop
				lowerCAmelCase												=  layer_norm_epsilon
				lowerCAmelCase												=  initializer_range
				lowerCAmelCase												=  summary_type
				lowerCAmelCase												=  summary_use_proj
				lowerCAmelCase												=  summary_activation
				lowerCAmelCase												=  summary_first_dropout
				lowerCAmelCase												=  summary_proj_to_labels
				super().__init__(**SCREAMING_SNAKE_CASE_			)


