





from typing import List, Optional, Union

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


UpperCamelCase_												=	logging.get_logger(__name__)

UpperCamelCase_												=	{
    '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     snake_case_		(   a							):






 '''simple docstring'''





 __UpperCamelCase       =      'informer'
 __UpperCamelCase       =      {
     'hidden_size': 'd_model',
     'num_attention_heads': 'encoder_attention_heads',
     'num_hidden_layers': 'encoder_layers',
 }

 def __init__(  self,		A_ = None,		A_ = None,		A_ = "student_t",		A_ = "nll",		A_ = 1,		A_ = None,		A_ = "mean",		A_ = 0,		A_ = 0,		A_ = 0,		A_ = 0,		A_ = None,		A_ = None,		A_ = 64,		A_ = 32,		A_ = 32,		A_ = 2,		A_ = 2,		A_ = 2,		A_ = 2,		A_ = True,		A_ = "gelu",		A_ = 0.05,		A_ = 0.1,		A_ = 0.1,		A_ = 0.1,		A_ = 0.1,		A_ = 100,		A_ = 0.02,		A_=True,		A_ = "prob",		A_ = 5,		A_ = True,		**A_,		)	->       int:
    # time series specific configuration
    UpperCAmelCase__						=prediction_length
    UpperCAmelCase__						=context_length or prediction_length
    UpperCAmelCase__						=distribution_output
    UpperCAmelCase__						=loss
    UpperCAmelCase__						=input_size
    UpperCAmelCase__						=num_time_features
    UpperCAmelCase__						=lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
    UpperCAmelCase__						=scaling
    UpperCAmelCase__						=num_dynamic_real_features
    UpperCAmelCase__						=num_static_real_features
    UpperCAmelCase__						=num_static_categorical_features

    # set cardinality
    if cardinality and num_static_categorical_features > 0:
       if len(A_		) != num_static_categorical_features:
          raise ValueError(
              "The cardinality should be a list of the same length as `num_static_categorical_features`"		)
       UpperCAmelCase__						=cardinality
    else:
       UpperCAmelCase__						=[0]

    # set embedding_dimension
    if embedding_dimension and num_static_categorical_features > 0:
       if len(A_		) != num_static_categorical_features:
          raise ValueError(
              "The embedding dimension should be a list of the same length as `num_static_categorical_features`"		)
       UpperCAmelCase__						=embedding_dimension
    else:
       UpperCAmelCase__						=[min(50,		(cat + 1) // 2		) for cat in self.cardinality]

    UpperCAmelCase__						=num_parallel_samples

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

    UpperCAmelCase__						=dropout
    UpperCAmelCase__						=attention_dropout
    UpperCAmelCase__						=activation_dropout
    UpperCAmelCase__						=encoder_layerdrop
    UpperCAmelCase__						=decoder_layerdrop

    UpperCAmelCase__						=activation_function
    UpperCAmelCase__						=init_std

    UpperCAmelCase__						=use_cache

    # Informer
    UpperCAmelCase__						=attention_type
    UpperCAmelCase__						=sampling_factor
    UpperCAmelCase__						=distil

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






 @property
 def  __UpperCAmelCase						(  self		)	->       int:
    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


UpperCamelCase_												=	logging.get_logger(__name__)

UpperCamelCase_												=	{
    'naver-clova-ix/donut-base': 'https://huggingface.co/naver-clova-ix/donut-base/resolve/main/config.json',
    # See all Donut models at https://huggingface.co/models?filter=donut-swin
}

class     snake_case_		(   a							):






 '''simple docstring'''





 __UpperCamelCase       =      'donut-swin'

 __UpperCamelCase       =      {
     'num_attention_heads': 'num_heads',
     'num_hidden_layers': 'num_layers',
 }

 def __init__(  self,		A_=224,		A_=4,		A_=3,		A_=96,		A_=[2, 2, 6, 2],		A_=[3, 6, 12, 24],		A_=7,		A_=4.0,		A_=True,		A_=0.0,		A_=0.0,		A_=0.1,		A_="gelu",		A_=False,		A_=0.02,		A_=1E-5,		**A_,		)	->       List[str]:
    super().__init__(**A_		)

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



