-
Notifications
You must be signed in to change notification settings - Fork 7
/
pretrain_protbert.yaml
58 lines (51 loc) · 1.14 KB
/
pretrain_protbert.yaml
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
output_dir: ~/scratch/protst_output/
dataset:
class: UniProtSeqText
path: ~/scratch/protein-datasets/
seq_lazy: True
atom_feature: null
bond_feature: null
transform:
class: Compose
transforms:
- class: TruncateProtein
max_length: 450
random: True
- class: ProteinView
view: "residue"
fix_text_model: True
lr_ratio: 0.1 # add this line when fine-tuning the protein encoder
task:
class: ProtSTMMP
protein_model:
class: PretrainProtBert
path: ~/scratch/protbert-model-weights/
mask_modeling: True
output_dim: 512
readout: pooler
text_model:
class: PubMedBERT
model: {{ text_model }} # PubMedBERT-abs / PubMedBERT-full
output_dim: 512 # NOTE: same as the output_dim of protein_model
readout: mean
fusion_model:
class: CrossAttention
hidden_dim: 512
num_layers: 1
num_heads: 8
batch_norm: True
protein2text: True
text2protein: True
mlm_weight: 1.0
mmp_weight: 1.0
mask_rate: 0.15
num_mlp_layer: 2
global_contrast: True
optimizer:
class: Adam
lr: 1.0e-5
engine:
gpus: [0, 1, 2, 3]
batch_size: 3
train:
num_epoch: 20