


from typing import List, Optional, Union

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


lowerCAmelCase			=				logging.get_logger(__name__)

lowerCAmelCase			=				{
    'huggingface/time-series-transformer-tourism-monthly': (
        'https://huggingface.co/huggingface/time-series-transformer-tourism-monthly/resolve/main/config.json'
    ),
    # See all TimeSeriesTransformer models at https://huggingface.co/models?filter=time_series_transformer
}


class 			_a				(     UpperCamelCase__     ):
							_lowercase      :     Optional[Any]     =					'''time_series_transformer'''
							_lowercase      :     List[str]     =					{
							    '''hidden_size''': '''d_model''',
							    '''num_attention_heads''': '''encoder_attention_heads''',
							    '''num_hidden_layers''': '''encoder_layers''',
							}

							def __init__(				self:      str       ,		UpperCamelCase_:      Optional[int] = None       ,		UpperCamelCase_:      Optional[int] = None       ,		UpperCamelCase_:      str = "student_t"       ,		UpperCamelCase_:      str = "nll"       ,		UpperCamelCase_:      int = 1       ,		UpperCamelCase_:      List[int] = [1, 2, 3, 4, 5, 6, 7]       ,		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 = 32       ,		UpperCamelCase_:      int = 32       ,		UpperCamelCase_:      int = 2       ,		UpperCamelCase_:      int = 2       ,		UpperCamelCase_:      int = 2       ,		UpperCamelCase_:      int = 2       ,		UpperCamelCase_:      bool = True       ,		UpperCamelCase_:      str = "gelu"       ,		UpperCamelCase_:      int = 64       ,		UpperCamelCase_:      float = 0.1       ,		UpperCamelCase_:      float = 0.1       ,		UpperCamelCase_:      float = 0.1       ,		UpperCamelCase_:      float = 0.1       ,		UpperCamelCase_:      float = 0.1       ,		UpperCamelCase_:      int = 100       ,		UpperCamelCase_:      float = 0.02       ,		UpperCamelCase_:      List[Any]=True       ,		**UpperCamelCase_:      List[str]       ,		)     ->  str:





									"""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
									lowercase__				= scaling
									lowercase__				= num_dynamic_real_features
									lowercase__				= num_static_real_features
									lowercase__				= num_static_categorical_features
									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]
									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(UpperCamelCase_				) + 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

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


							@property
							def  lowerCamelCase_					(				self:      Optional[int]				)     ->  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 collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


_SCREAMING_SNAKE_CASE									=				logging.get_logger(__name__)

_SCREAMING_SNAKE_CASE									=				{
    "facebook/deit-base-distilled-patch16-224": (
        "https://huggingface.co/facebook/deit-base-patch16-224/resolve/main/config.json"
    ),
    # See all DeiT models at https://huggingface.co/models?filter=deit
}

class  lowerCAmelCase_		(		__magic_name__		):
 __lowerCamelCase    :				Optional[int]								=       "deit"




 def __init__(						self      ,  _lowerCAmelCase=768      ,  _lowerCAmelCase=12      ,  _lowerCAmelCase=12      ,  _lowerCAmelCase=3072      ,  _lowerCAmelCase="gelu"      ,  _lowerCAmelCase=0.0      ,  _lowerCAmelCase=0.0      ,  _lowerCAmelCase=0.02      ,  _lowerCAmelCase=1E-12      ,  _lowerCAmelCase=224      ,  _lowerCAmelCase=16      ,  _lowerCAmelCase=3      ,  _lowerCAmelCase=True      ,  _lowerCAmelCase=16      ,  **_lowerCAmelCase      ,  )     ->				Dict:
     super().__init__(**_lowerCAmelCase		)

     _lowerCAmelCase						      =   hidden_size
     _lowerCAmelCase						      =   num_hidden_layers
     _lowerCAmelCase						      =   num_attention_heads
     _lowerCAmelCase						      =   intermediate_size
     _lowerCAmelCase						      =   hidden_act
     _lowerCAmelCase						      =   hidden_dropout_prob
     _lowerCAmelCase						      =   attention_probs_dropout_prob
     _lowerCAmelCase						      =   initializer_range
     _lowerCAmelCase						      =   layer_norm_eps
     _lowerCAmelCase						      =   image_size
     _lowerCAmelCase						      =   patch_size
     _lowerCAmelCase						      =   num_channels
     _lowerCAmelCase						      =   qkv_bias
     _lowerCAmelCase						      =   encoder_stride







class  lowerCAmelCase_		(		__magic_name__		):
 __lowerCamelCase    :				List[str]								=       version.parse("1.11"		)




 @property
 def 				_snake_case (						self		)     ->				Mapping[str, Mapping[int, str]]:
     return OrderedDict(
         [
             ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
         ]		)





 @property
 def 				_snake_case (						self		)     ->				float:
     return 1E-4


