CoolFace
Modelpublic

FlowVortex/SymTime

sourceHugging Faceapache-2.0updated 5mo agoView on Hugging Face
1likes13downloads
configuration_symtime.py67 linesDownload Raw Back to root
1from dataclasses import dataclass
2
3from transformers.configuration_utils import PretrainedConfig
4
5
6@dataclass
7class SymTimeConfig(PretrainedConfig):
8    """
9    Time series encoder configuration for SymTime Model.
10
11    Parameters
12    -----------
13    num_layers
14        The number of layers to be used for the encoder.
15    d_model
16        The dimension of the model.
17    d_ff
18        The dimension of the feedforward network.
19    num_heads
20        The number of heads to be used for the attention mechanism.
21    norm
22        The normalization to be used for the encoder.
23    attn_dropout
24        The dropout rate to be used for the attention mechanism.
25    dropout
26        The dropout rate to be used for the encoder.
27    act
28        The activation function to be used for the encoder.
29    pre_norm
30        Whether to use pre-norm for the encoder.
31    patch_size
32        The size of the patch to be used for the input data.
33    stride
34        The stride of the patch to be used for the input data.
35    """
36
37    model_type = "symtime"
38
39    def __init__(
40        self,
41        num_layers: int = 6,
42        d_model: int = 512,
43        d_ff: int = 2048,
44        num_heads: int = 8,
45        norm: str = "BatchNorm",
46        dropout: float = 0.1,
47        act: str = "gelu",
48        pre_norm: bool = False,
49        patch_size: int = 16,
50        stride: int = 16,
51        initializer_factor: float = 0.05,
52        **kwargs,
53    ) -> None:
54        self.patch_size = patch_size
55        self.stride = stride
56        self.num_layers = num_layers
57        self.d_model = d_model
58        self.num_heads = num_heads
59        self.d_ff = d_ff
60        self.norm = norm
61        self.dropout = dropout
62        self.act = act
63        self.pre_norm = pre_norm
64        self.initializer_factor = initializer_factor
65
66        super().__init__(**kwargs)
67