




"""simple docstring"""







from typing import List, Optional

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


A    =			logging.get_logger(__name__)

A    =			{
    'huggingface/autoformer-tourism-monthly': 'https://huggingface.co/huggingface/autoformer-tourism-monthly/resolve/main/config.json',
}






class      UpperCAmelCase__		(      UpperCamelCase     ):
		lowerCAmelCase_       :	Union[str, Any] 							=     """autoformer"""
		lowerCAmelCase_       :	int 							=     {
		    """hidden_size""": """d_model""",
		    """num_attention_heads""": """encoder_attention_heads""",
		    """num_hidden_layers""": """encoder_layers""",
		}



		def __init__( self  :    Optional[Any]      ,							snake_case  :    Optional[int] = None      ,							snake_case  :    Optional[int] = None      ,							snake_case  :    str = "student_t"      ,							snake_case  :    str = "nll"      ,							snake_case  :    int = 1      ,							snake_case  :    List[int] = [1, 2, 3, 4, 5, 6, 7]      ,							snake_case  :    bool = True      ,							snake_case  :    int = 0      ,							snake_case  :    int = 0      ,							snake_case  :    int = 0      ,							snake_case  :    int = 0      ,							snake_case  :    Optional[List[int]] = None      ,							snake_case  :    Optional[List[int]] = None      ,							snake_case  :    int = 64      ,							snake_case  :    int = 2      ,							snake_case  :    int = 2      ,							snake_case  :    int = 2      ,							snake_case  :    int = 2      ,							snake_case  :    int = 32      ,							snake_case  :    int = 32      ,							snake_case  :    str = "gelu"      ,							snake_case  :    float = 0.1      ,							snake_case  :    float = 0.1      ,							snake_case  :    float = 0.1      ,							snake_case  :    float = 0.1      ,							snake_case  :    float = 0.1      ,							snake_case  :    int = 100      ,							snake_case  :    float = 0.02      ,							snake_case  :    bool = True      ,							snake_case  :    Union[str, Any]=True      ,							snake_case  :    int = 10      ,							snake_case  :    int = 25      ,							snake_case  :    int = 3      ,							**snake_case  :    Dict      ,							)			->						Union[str, Any]:






									'''simple docstring'''

									A         =					prediction_length
									A         =					context_length if context_length is not None else prediction_length
									A         =					distribution_output
									A         =					loss
									A         =					input_size
									A         =					num_time_features
									A         =					lags_sequence
									A         =					scaling
									A         =					num_dynamic_real_features
									A         =					num_static_real_features
									A         =					num_static_categorical_features
									if cardinality is not None and num_static_categorical_features > 0:
																if len(snake_case				) != num_static_categorical_features:
																							raise ValueError(
																							    'The cardinality should be a list of the same length as `num_static_categorical_features`'				)
																A         =					cardinality
									else:
																A         =					[0]
									if embedding_dimension is not None and num_static_categorical_features > 0:
																if len(snake_case				) != num_static_categorical_features:
																							raise ValueError(
																							    'The embedding dimension should be a list of the same length as `num_static_categorical_features`'				)
																A         =					embedding_dimension
									else:
																A         =					[min(50      ,							(cat + 1) // 2				) for cat in self.cardinality]
									A         =					num_parallel_samples

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

									A         =					dropout
									A         =					attention_dropout
									A         =					activation_dropout
									A         =					encoder_layerdrop
									A         =					decoder_layerdrop

									A         =					activation_function
									A         =					init_std

									A         =					use_cache

									# Autoformer
									A         =					label_length
									A         =					moving_average
									A         =					autocorrelation_factor

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



		@property
		def 					A_		( self  :    List[str]				)			->						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"""







# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


A    =			{'configuration_mra': ['MRA_PRETRAINED_CONFIG_ARCHIVE_MAP', 'MraConfig']}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							A    =			[
							    'MRA_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'MraForMaskedLM',
							    'MraForMultipleChoice',
							    'MraForQuestionAnswering',
							    'MraForSequenceClassification',
							    'MraForTokenClassification',
							    'MraLayer',
							    'MraModel',
							    'MraPreTrainedModel',
							]


if TYPE_CHECKING:
							from .configuration_mra import MRA_PRETRAINED_CONFIG_ARCHIVE_MAP, MraConfig

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_mra import (
														    MRA_PRETRAINED_MODEL_ARCHIVE_LIST,
														    MraForMaskedLM,
														    MraForMultipleChoice,
														    MraForQuestionAnswering,
														    MraForSequenceClassification,
														    MraForTokenClassification,
														    MraLayer,
														    MraModel,
														    MraPreTrainedModel,
														)
else:
							import sys

							A    =			_LazyModule(__name__, globals()['__file__'], _import_structure)



