
    Z j!                     d    S r SSKJr  SSKJr  SSKJr  \" SS9\ " S S	\5      5       5       rS	/rg
)z PatchTSMixer model configuration    )strict   )PreTrainedConfig)auto_docstringzibm/patchtsmixer-etth1-pretrain)
checkpointc                   p  ^  \ rS rSr% SrSrSSS.rSr\\	S'   S	r
\\	S
'   Sr\\	S'   S	r\\	S'   Sr\\	S'   S	r\\	S'   Sr\\	S'   Sr\\	S'   Sr\\-  \	S'   Sr\\	S'   Sr\\	S'   Sr\\	S'   Sr\\	S'   Sr\\	S'   Sr\\	S'   Sr\\	S '   S!r\\-  S"-  \	S#'   S$r\\	S%'   S&r\\	S''   S(r\\	S)'   S*r \\	S+'   S,r!\\	S-'   S.r"\#\   \$\S/4   -  \-  S"-  \	S0'   S1r%\\	S2'   Sr&\\	S3'   Sr'\\	S4'   S"r(\#\   S"-  \	S5'   Sr)\\-  \	S6'   S7r*\\	S8'   S9r+\\	S:'   S"r,\#S"-  \	S;'   Sr-\\	S<'   S"r.\#S"-  \	S='   S>r/\S"-  \	S?'   U 4S@ jr0SAr1U =r2$ )BPatchTSMixerConfig   a{  
context_length (`int`, *optional*, defaults to 32):
    The context/history length for the input sequence.
patch_length (`int`, *optional*, defaults to 8):
    The patch length for the input sequence.
patch_stride (`int`, *optional*, defaults to 8):
    Determines the overlap between two consecutive patches. Set it to patch_length (or greater), if we want
    non-overlapping patches.
num_parallel_samples (`int`, *optional*, defaults to 100):
    The number of samples to generate in parallel for probabilistic forecast.
expansion_factor (`int`, *optional*, defaults to 2):
    Expansion factor to use inside MLP. Recommended range is 2-5. Larger value indicates more complex model.
mode (`str`, *optional*, defaults to `"common_channel"`):
    Mixer Mode. Determines how to process the channels. Allowed values: "common_channel", "mix_channel". In
    "common_channel" mode, we follow Channel-independent modelling with no explicit channel-mixing. Channel
    mixing happens in an implicit manner via shared weights across channels. (preferred first approach) In
    "mix_channel" mode, we follow explicit channel-mixing in addition to patch and feature mixer. (preferred
    approach when channel correlations are very important to model)
gated_attn (`bool`, *optional*, defaults to `True`):
    Enable Gated Attention.
norm_mlp (`str`, *optional*, defaults to `"LayerNorm"`):
    Normalization layer (BatchNorm or LayerNorm).
self_attn (`bool`, *optional*, defaults to `False`):
    Enable Tiny self attention across patches. This can be enabled when the output of Vanilla PatchTSMixer with
    gated attention is not satisfactory. Enabling this leads to explicit pair-wise attention and modelling
    across patches.
self_attn_heads (`int`, *optional*, defaults to 1):
    Number of self-attention heads. Works only when `self_attn` is set to `True`.
use_positional_encoding (`bool`, *optional*, defaults to `False`):
    Enable the use of positional embedding for the tiny self-attention layers. Works only when `self_attn` is
    set to `True`.
positional_encoding_type (`str`, *optional*, defaults to `"sincos"`):
    Positional encodings. Options `"random"` and `"sincos"` are supported. Works only when
    `use_positional_encoding` is set to `True`
scaling (`string` or `bool`, *optional*, defaults to `"std"`):
    Whether to scale the input targets via "mean" scaler, "std" scaler or no scaler if `None`. If `True`, the
    scaler is set to "mean".
loss (`string`, *optional*, defaults to `"mse"`):
    The loss function for the model corresponding to the `distribution_output` head. For parametric
    distributions it is the negative log likelihood ("nll") and for point estimates it is the mean squared
    error "mse".
norm_eps (`float`, *optional*, defaults to 1e-05):
    A value added to the denominator for numerical stability of normalization.
mask_type (`str`, *optional*, defaults to `"random"`):
    Type of masking to use for Masked Pretraining mode. Allowed values are "random", "forecast". In Random
    masking, points are masked randomly. In Forecast masking, points are masked towards the end.
random_mask_ratio (`float`, *optional*, defaults to 0.5):
    Masking ratio to use when `mask_type` is `random`. Higher value indicates more masking.
num_forecast_mask_patches (`int` or `list`, *optional*, defaults to `[2]`):
    Number of patches to be masked at the end of each batch sample. If it is an integer, all the samples in the
    batch will have the same number of masked patches. If it is a list, samples in the batch will be randomly
    masked by numbers defined in the list. This argument is only used for forecast pretraining.
mask_value (`float`, *optional*, defaults to `0.0`):
    Mask value to use.
masked_loss (`bool`, *optional*, defaults to `True`):
    Whether to compute pretraining loss only at the masked portions, or on the entire output.
channel_consistent_masking (`bool`, *optional*, defaults to `True`):
    When true, masking will be same across all channels of a timeseries. Otherwise, masking positions will vary
    across channels.
unmasked_channel_indices (`list`, *optional*):
    Channels that are not masked during pretraining.
head_dropout (`float`, *optional*, defaults to 0.2):
    The dropout probability the `PatchTSMixer` head.
distribution_output (`string`, *optional*, defaults to `"student_t"`):
    The distribution emission head for the model when loss is "nll". Could be either "student_t", "normal" or
    "negative_binomial".
prediction_length (`int`, *optional*, defaults to 16):
    Number of time steps to forecast for a forecasting task. Also known as the Forecast Horizon.
prediction_channel_indices (`list`, *optional*):
    List of channel indices to forecast. If None, forecast all channels. Target data is expected to have all
    channels and we explicitly filter the channels in prediction and target before loss computation.
num_targets (`int`, *optional*, defaults to 3):
    Number of targets (dimensionality of the regressed variable) for a regression task.
output_range (`list`, *optional*):
    Output range to restrict for the regression task. Defaults to None.
head_aggregation (`str`, *optional*, defaults to `"max_pool"`):
    Aggregation mode to enable for classification or regression task. Allowed values are `None`, "use_last",
    "max_pool", "avg_pool".

Example:

```python
>>> from transformers import PatchTSMixerConfig, PatchTSMixerModel

>>> # Initializing a default PatchTSMixer configuration
>>> configuration = PatchTSMixerConfig()

>>> # Randomly initializing a model (with random weights) from the configuration
>>> model = PatchTSMixerModel(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
```patchtsmixerd_model
num_layers)hidden_sizenum_hidden_layers    context_length   patch_length   num_input_channelspatch_strided   num_parallel_samples   expansion_factorr   g?dropoutcommon_channelmodeT
gated_attn	LayerNormnorm_mlpF	self_attnself_attn_headsuse_positional_encodingsincospositional_encoding_typestdNscalingmselossg{Gz?init_stdgh㈵>norm_epsrandom	mask_typeg      ?random_mask_ratio)r   .num_forecast_mask_patchesr   
mask_valuemasked_losschannel_consistent_maskingunmasked_channel_indiceshead_dropout	student_tdistribution_output   prediction_lengthprediction_channel_indicesnum_targetsoutput_rangemax_poolhead_aggregationc                    > [        U R                  U R                  5      U R                  -
  U R                  -  S-   U l        SU l        [        TU ]  " S0 UD6  g )Nr   T )maxr   r   r   num_patches
patch_lastsuper__post_init__)selfkwargs	__class__s     ڌ/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/transformers/models/patchtsmixer/configuration_patchtsmixer.pyrD    PatchTSMixerConfig.__post_init__   sR     3 3T5F5FG$J[J[[`d`q`qqtuu''    )rA   rB   )3__name__
__module____qualname____firstlineno____doc__
model_typeattribute_mapr   int__annotations__r   r   r   r   r   r   r   r   floatr   strr   boolr    r!   r"   r#   r%   r'   r)   r*   r+   r-   r.   r/   listtupler0   r1   r2   r3   r4   r6   r8   r9   r:   r;   r=   rD   __static_attributes____classcell__)rG   s   @rH   r	   r	      s   \|  J )M
 NCL#L# ###GScJGUS[ D# JHcItOS$)T)$,c,!&GS4Z$&D#HeHeIs"u"JNtCy5c?:S@4GNJK'++15d3i$.5 #L%#+#**s.2t2K $L$+$#-cDj-( (rJ   r	   N)	rO   huggingface_hub.dataclassesr   configuration_utilsr   utilsr   r	   __all__r?   rJ   rH   <module>r_      sK    ' . 3 # <=K() K(  >K(\  
 rJ   