

'''simple docstring'''

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 	lowerCAmelCase  (   A ):
       lowerCAmelCase_												=			"informer"
       lowerCAmelCase_												=			{
           "hidden_size": "d_model",
           "num_attention_heads": "encoder_attention_heads",
           "num_hidden_layers": "encoder_layers",
       }







       def __init__(				self      :			List[Any]    ,   __lowercase      :			Optional[int] = None    ,   __lowercase      :			Optional[int] = None    ,   __lowercase      :			str = "student_t"    ,   __lowercase      :			str = "nll"    ,   __lowercase      :			int = 1    ,   __lowercase      :			List[int] = None    ,   __lowercase      :			Optional[Union[str, bool]] = "mean"    ,   __lowercase      :			int = 0    ,   __lowercase      :			int = 0    ,   __lowercase      :			int = 0    ,   __lowercase      :			int = 0    ,   __lowercase      :			Optional[List[int]] = None    ,   __lowercase      :			Optional[List[int]] = None    ,   __lowercase      :			int = 64    ,   __lowercase      :			int = 32    ,   __lowercase      :			int = 32    ,   __lowercase      :			int = 2    ,   __lowercase      :			int = 2    ,   __lowercase      :			int = 2    ,   __lowercase      :			int = 2    ,   __lowercase      :			bool = True    ,   __lowercase      :			str = "gelu"    ,   __lowercase      :			float = 0.0_5    ,   __lowercase      :			float = 0.1    ,   __lowercase      :			float = 0.1    ,   __lowercase      :			float = 0.1    ,   __lowercase      :			float = 0.1    ,   __lowercase      :			int = 100    ,   __lowercase      :			float = 0.0_2    ,   __lowercase      :			str=True    ,   __lowercase      :			str = "prob"    ,   __lowercase      :			int = 5    ,   __lowercase      :			bool = True    ,   **__lowercase      :			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 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(__lowercase   ) != 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(__lowercase   ) != 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=__lowercase    ,   **__lowercase   )







       @property
       def       snake_case (				self      :			Optional[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 typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
    is_vision_available,
)


UpperCAmelCase					 =	{
    '''configuration_owlvit''': [
        '''OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''OwlViTConfig''',
        '''OwlViTOnnxConfig''',
        '''OwlViTTextConfig''',
        '''OwlViTVisionConfig''',
    ],
    '''processing_owlvit''': ['''OwlViTProcessor'''],
}


try:
       if not is_vision_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       UpperCAmelCase					 =	['''OwlViTFeatureExtractor''']
       UpperCAmelCase					 =	['''OwlViTImageProcessor''']

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       UpperCAmelCase					 =	[
           '''OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST''',
           '''OwlViTModel''',
           '''OwlViTPreTrainedModel''',
           '''OwlViTTextModel''',
           '''OwlViTVisionModel''',
           '''OwlViTForObjectDetection''',
       ]

if TYPE_CHECKING:
       from .configuration_owlvit import (
           OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP,
           OwlViTConfig,
           OwlViTOnnxConfig,
           OwlViTTextConfig,
           OwlViTVisionConfig,
       )
       from .processing_owlvit import OwlViTProcessor

       try:
              if not is_vision_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .feature_extraction_owlvit import OwlViTFeatureExtractor
              from .image_processing_owlvit import OwlViTImageProcessor

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_owlvit import (
                  OWLVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
                  OwlViTForObjectDetection,
                  OwlViTModel,
                  OwlViTPreTrainedModel,
                  OwlViTTextModel,
                  OwlViTVisionModel,
              )

else:
       import sys

       UpperCAmelCase					 =	_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)


