-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigs.py
76 lines (63 loc) · 1.87 KB
/
configs.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
from yacs.config import CfgNode as CN
import torch
import yaml
Config = CN()
Config.dump()
Config.protein = CN()
Config.protein.padding = True
Config.protein.max_antibody_len = 110
Config.protein.max_antigen_len = 800
Config.protein.use_bn = False
Config.protein.dropout = 0.1
Config.protein.channel = 192
# bcn setting
Config.bcn = CN()
Config.bcn.heads = 2
# MLP predict
Config.predict = CN()
Config.predict.name = "MLP"
# Config.predict.IN_DIM = 256 过拟合
Config.predict.in_dim = 256
Config.predict.hidden_dim = 256
Config.predict.out_dim = 256
Config.predict.binary = 2
Config.predict.simple=False
# solver,超参数设置
Config.solver = CN()
Config.solver.train_epoch = 100
Config.solver.batch_size = 128
Config.solver.num_workers = 0
Config.solver.lr = 1e-3
Config.solver.seed = 0
Config.solver.weight_decay=0
Config.solver.end_epoch=50
# result
Config.result = CN()
Config.result.output_dir = "./result"
Config.result.save_model = True
# # Comet configs, ignore it If not installed.
# Config.comet = CN()
# # Please change to your own workspace name on comet.
# Config.comet.workspace = "xyh-123"
# Config.comet.project_name = "ag-ab-prediction"
# Config.comet.use = False
# Config.comet.tag = None
#train setting
Config.set = CN()
Config.set.dataset='HIV'
Config.set.model_name='DeepInterAware'
Config.set.device=0
Config.set.resume_path=None
Config.set.pretrain=False
Config.set.ab_model = 'ablang' #antiberty or ablang
Config.set.project=True
# Config.set.task='cls'
Config.set.unseen_task = 'unseen'
Config.set.phy=False
Config.set.alpha = 0.4
def get_cfg_defaults():
return Config.clone()
# Config.dump(stream=open('./configs/SAbDab.yml', 'w', encoding='utf-8'))
# print(Config)
# # with open('./configs/SAbDab.yml', 'w', encoding='utf-8') as f:
# # yaml.dump(data=Config, stream=f, allow_unicode=True)