"""simple docstring"""
from typing import List, Optional, Union

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


SCREAMING_SNAKE_CASE__   =					logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__   =					{
    "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 					lowerCAmelCase_      (     lowerCAmelCase   ):



				"""simple docstring"""
				_lowerCAmelCase       :      List[Any]     					=  """time_series_transformer"""
				_lowerCAmelCase       :      List[Any]     					=  {
				    """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 = "mean"						,      lowerCAmelCase = 0						,      lowerCAmelCase = 0						,      lowerCAmelCase = 0						,      lowerCAmelCase = 0						,      lowerCAmelCase = None						,      lowerCAmelCase = None						,      lowerCAmelCase = 32						,      lowerCAmelCase = 32						,      lowerCAmelCase = 2						,      lowerCAmelCase = 2						,      lowerCAmelCase = 2						,      lowerCAmelCase = 2						,      lowerCAmelCase = True						,      lowerCAmelCase = "gelu"						,      lowerCAmelCase = 64						,      lowerCAmelCase = 0.1						,      lowerCAmelCase = 0.1						,      lowerCAmelCase = 0.1						,      lowerCAmelCase = 0.1						,      lowerCAmelCase = 0.1						,      lowerCAmelCase = 1_00						,      lowerCAmelCase = 0.02						,      lowerCAmelCase=True						,      **lowerCAmelCase						,      ):






										"""simple docstring"""

										snake_case        =     prediction_length
										snake_case        =     context_length or prediction_length
										snake_case        =     distribution_output
										snake_case        =     loss
										snake_case        =     input_size
										snake_case        =     num_time_features
										snake_case        =     lags_sequence
										snake_case        =     scaling
										snake_case        =     num_dynamic_real_features
										snake_case        =     num_static_real_features
										snake_case        =     num_static_categorical_features
										if cardinality 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`'      )
																snake_case        =     cardinality
										else:
																snake_case        =     [0]
										if embedding_dimension 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`'      )
																snake_case        =     embedding_dimension
										else:
																snake_case        =     [min(50						,      (cat + 1) // 2      ) for cat in self.cardinality]
										snake_case        =     num_parallel_samples

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

										snake_case        =     dropout
										snake_case        =     attention_dropout
										snake_case        =     activation_dropout
										snake_case        =     encoder_layerdrop
										snake_case        =     decoder_layerdrop

										snake_case        =     activation_function
										snake_case        =     init_std

										snake_case        =     use_cache

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

				@property
				def 						snake_case	(			self      ):






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


SCREAMING_SNAKE_CASE__   =					logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__   =					{
    "microsoft/swinv2-tiny-patch4-window8-256": (
        "https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256/resolve/main/config.json"
    ),
}



class 					lowerCAmelCase_      (     lowerCAmelCase   ):



				"""simple docstring"""
				_lowerCAmelCase       :      Tuple     					=  """swinv2"""

				_lowerCAmelCase       :      Any     					=  {
				    """num_attention_heads""": """num_heads""",
				    """num_hidden_layers""": """num_layers""",
				}

				def __init__(			self						,      lowerCAmelCase=2_24						,      lowerCAmelCase=4						,      lowerCAmelCase=3						,      lowerCAmelCase=96						,      lowerCAmelCase=[2, 2, 6, 2]						,      lowerCAmelCase=[3, 6, 12, 24]						,      lowerCAmelCase=7						,      lowerCAmelCase=4.0						,      lowerCAmelCase=True						,      lowerCAmelCase=0.0						,      lowerCAmelCase=0.0						,      lowerCAmelCase=0.1						,      lowerCAmelCase="gelu"						,      lowerCAmelCase=False						,      lowerCAmelCase=0.02						,      lowerCAmelCase=1E-5						,      lowerCAmelCase=32						,      **lowerCAmelCase						,      ):






										"""simple docstring"""

										super().__init__(**lowerCAmelCase      )

										snake_case        =     image_size
										snake_case        =     patch_size
										snake_case        =     num_channels
										snake_case        =     embed_dim
										snake_case        =     depths
										snake_case        =     len(lowerCAmelCase      )
										snake_case        =     num_heads
										snake_case        =     window_size
										snake_case        =     mlp_ratio
										snake_case        =     qkv_bias
										snake_case        =     hidden_dropout_prob
										snake_case        =     attention_probs_dropout_prob
										snake_case        =     drop_path_rate
										snake_case        =     hidden_act
										snake_case        =     use_absolute_embeddings
										snake_case        =     layer_norm_eps
										snake_case        =     initializer_range
										snake_case        =     encoder_stride
										# we set the hidden_size attribute in order to make Swinv2 work with VisionEncoderDecoderModel
										# this indicates the channel dimension after the last stage of the model
										snake_case        =     int(embed_dim * 2 ** (len(lowerCAmelCase      ) - 1)      )
										snake_case        =     (0, 0, 0, 0)


