-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.py
58 lines (52 loc) · 1.53 KB
/
base.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from yacs.config import CfgNode
_C = CfgNode()
_C.DATA = CfgNode()
_C.DATA.IMAGE_SIZE = 256
_C.DATA.IN_CHANS = 3
_C.DATA.NUM_CLASSES = 0
_C.DATA.CLASS_FREQ = None
_C.DATA.MEAN = 0.
_C.DATA.STD = 1.
_C.MODEL = CfgNode()
_C.MODEL.ENCODER = CfgNode()
_C.MODEL.ENCODER.TYPE = None
_C.MODEL.ENCODER.NAME = None
_C.MODEL.ENCODER.PATCH_SIZE = 4
_C.MODEL.ENCODER.WINDOW_SIZE = None
_C.MODEL.ENCODER.GROUP_SIZE = None
_C.MODEL.ENCODER.SPLIT_SIZE = None
_C.MODEL.ENCODER.DEPTHS = None
_C.MODEL.ENCODER.NUM_PATHS = None
_C.MODEL.ENCODER.NUM_HEADS = None
_C.MODEL.ENCODER.EMBED_DIM = None
_C.MODEL.ENCODER.MLP_RATIO = None
_C.MODEL.ENCODER.SR_RATIOS = None
_C.MODEL.ENCODER.KV_SCALE = None
_C.MODEL.ENCODER.QK_SCALE = None
_C.MODEL.ENCODER.QKV_BIAS = None
_C.MODEL.ENCODER.DROP_RATE = 0.0
_C.MODEL.ENCODER.DROP_PATH_RATE = 0.1
_C.MODEL.ENCODER.ATTN_DROP_RATE = 0.0
_C.MODEL.ENCODER.USE_ABS_POS_EMBED = False
_C.MODEL.ENCODER.USE_REL_POS_EMBED = False
_C.MODEL.ENCODER.USE_BN_IN_ATTN = False
_C.MODEL.ENCODER.USE_MULTI_MERGE = False
_C.MODEL.ENCODER.USE_GHOST_FFN = False
_C.MODEL.ENCODER.USE_IRFFN = False
_C.MODEL.ENCODER.USE_LPU = False
_C.MODEL.DECODER = CfgNode()
_C.MODEL.DECODER.TYPE = None
_C.MODEL.DECODER.NAME = None
_C.MODEL.DECODER.DEPTH = None
_C.MODEL.DECODER.FUSE_OP = None
_C.MODEL.DECODER.IN_FEATURES = None
_C.MODEL.DECODER.EMBED_DIM = None
_C.TRAIN = CfgNode()
_C.TRAIN.EPOCHS = 100
_C.TRAIN.WARMUP_EPOCHS = 3
_C.TRAIN.WEIGHT_DECAY = 1e-2
_C.TRAIN.LR = 3e-4
_C.TRAIN.LR_DECAY = 0.1
_C.TRAIN.LR_STEP = 1
_C.TRAIN.LR_SCHEDULER = 'poly'
_C.TRAIN.CLIP_GRAD = 1.0