-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
39 lines (29 loc) · 785 Bytes
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from dataclasses import dataclass
from enum import Enum
@dataclass
class GraphTransformerConfig:
num_heads: int = 2
ln_type: str = "pre"
num_mlp_layers: int = 0
class SeqPosEnc(Enum):
Pos = 0
Rotary = 1
@dataclass
class SeqTransformerConfig:
num_heads: int = 2
posenc: SeqPosEnc = SeqPosEnc.Rotary
@dataclass
class ModelConfig:
"""Generic configuration for models
Attributes
----------
num_layers : int
The number of layers in the model
num_emb : int
The number of dimensions of the embedding
"""
num_layers: int = 3
num_emb: int = 128
dropout: float = 0
graph_transformer: GraphTransformerConfig = GraphTransformerConfig()
seq_transformer: SeqTransformerConfig = SeqTransformerConfig()