Caleb Ellington
commited on
Commit
·
01ed901
1
Parent(s):
4bf16e7
update with major refactor
Browse files- README.md +2 -2
- config.yaml +8 -8
README.md
CHANGED
@@ -20,12 +20,12 @@ snapshot_download(repo_id=model_name, local_dir=genbio_models_path)
|
|
20 |
### Load model for inference
|
21 |
```python
|
22 |
import torch
|
23 |
-
from
|
24 |
|
25 |
ckpt_path = genbio_models_path.joinpath('model.ckpt')
|
26 |
model = SequenceClassification.load_from_checkpoint(ckpt_path, strict_loading=False).eval()
|
27 |
|
28 |
-
collated_batch = model.
|
29 |
logits = model(collated_batch)
|
30 |
print(logits)
|
31 |
print(torch.argmax(logits, dim=-1))
|
|
|
20 |
### Load model for inference
|
21 |
```python
|
22 |
import torch
|
23 |
+
from modelgenerator.tasks import SequenceClassification
|
24 |
|
25 |
ckpt_path = genbio_models_path.joinpath('model.ckpt')
|
26 |
model = SequenceClassification.load_from_checkpoint(ckpt_path, strict_loading=False).eval()
|
27 |
|
28 |
+
collated_batch = model.transform({"sequences": ["ACGT", "AGCT"]})
|
29 |
logits = model(collated_batch)
|
30 |
print(logits)
|
31 |
print(torch.argmax(logits, dim=-1))
|
config.yaml
CHANGED
@@ -37,7 +37,7 @@ trainer:
|
|
37 |
class_path: lightning.pytorch.loggers.WandbLogger
|
38 |
init_args:
|
39 |
name: peptide_HLA_MHC_affinity_proteinmoe_16B_1113
|
40 |
-
save_dir: /lustre/scratch/shared-folders/bio_project/shuxian/
|
41 |
version: null
|
42 |
offline: false
|
43 |
dir: null
|
@@ -75,7 +75,7 @@ trainer:
|
|
75 |
log_weight_decay: false
|
76 |
- class_path: lightning.pytorch.callbacks.ModelCheckpoint
|
77 |
init_args:
|
78 |
-
dirpath: /lustre/scratch/shared-folders/bio_project/shuxian/
|
79 |
filename: best_val:{epoch}-{val_auroc:.3f}
|
80 |
monitor: val_auroc
|
81 |
verbose: false
|
@@ -134,12 +134,12 @@ trainer:
|
|
134 |
plugins: null
|
135 |
sync_batchnorm: false
|
136 |
reload_dataloaders_every_n_epochs: 0
|
137 |
-
default_root_dir: /lustre/scratch/shared-folders/bio_project/shuxian/
|
138 |
model:
|
139 |
-
class_path:
|
140 |
init_args:
|
141 |
backbone:
|
142 |
-
class_path:
|
143 |
init_args:
|
144 |
from_scratch: false
|
145 |
max_length: 64
|
@@ -161,7 +161,7 @@ model:
|
|
161 |
attention_probs_dropout_prob: 0.0
|
162 |
model_init_args: null
|
163 |
adapter:
|
164 |
-
class_path:
|
165 |
init_args:
|
166 |
pooling: mean_pooling
|
167 |
hidden_sizes:
|
@@ -189,7 +189,7 @@ model:
|
|
189 |
differentiable: false
|
190 |
fused: null
|
191 |
lr_scheduler:
|
192 |
-
class_path:
|
193 |
init_args:
|
194 |
warmup_ratio: 0.05
|
195 |
num_warmup_steps: null
|
@@ -199,7 +199,7 @@ model:
|
|
199 |
strict_loading: true
|
200 |
reset_optimizer_states: false
|
201 |
data:
|
202 |
-
class_path:
|
203 |
init_args:
|
204 |
path: biomap-research/peptide_hla_mhc_affinity
|
205 |
class_filter: null
|
|
|
37 |
class_path: lightning.pytorch.loggers.WandbLogger
|
38 |
init_args:
|
39 |
name: peptide_HLA_MHC_affinity_proteinmoe_16B_1113
|
40 |
+
save_dir: /lustre/scratch/shared-folders/bio_project/shuxian/modelgenerator/logs
|
41 |
version: null
|
42 |
offline: false
|
43 |
dir: null
|
|
|
75 |
log_weight_decay: false
|
76 |
- class_path: lightning.pytorch.callbacks.ModelCheckpoint
|
77 |
init_args:
|
78 |
+
dirpath: /lustre/scratch/shared-folders/bio_project/shuxian/modelgenerator/logs/xtrimo_benchmark_gbft_reproduction/peptide_HLA_MHC_affinity_proteinmoe_16B_1113
|
79 |
filename: best_val:{epoch}-{val_auroc:.3f}
|
80 |
monitor: val_auroc
|
81 |
verbose: false
|
|
|
134 |
plugins: null
|
135 |
sync_batchnorm: false
|
136 |
reload_dataloaders_every_n_epochs: 0
|
137 |
+
default_root_dir: /lustre/scratch/shared-folders/bio_project/shuxian/modelgenerator/logs
|
138 |
model:
|
139 |
+
class_path: modelgenerator.tasks.SequenceClassification
|
140 |
init_args:
|
141 |
backbone:
|
142 |
+
class_path: modelgenerator.backbones.proteinfm
|
143 |
init_args:
|
144 |
from_scratch: false
|
145 |
max_length: 64
|
|
|
161 |
attention_probs_dropout_prob: 0.0
|
162 |
model_init_args: null
|
163 |
adapter:
|
164 |
+
class_path: modelgenerator.adapters.MLPPoolAdapter
|
165 |
init_args:
|
166 |
pooling: mean_pooling
|
167 |
hidden_sizes:
|
|
|
189 |
differentiable: false
|
190 |
fused: null
|
191 |
lr_scheduler:
|
192 |
+
class_path: modelgenerator.lr_schedulers.CosineWithWarmup
|
193 |
init_args:
|
194 |
warmup_ratio: 0.05
|
195 |
num_warmup_steps: null
|
|
|
199 |
strict_loading: true
|
200 |
reset_optimizer_states: false
|
201 |
data:
|
202 |
+
class_path: modelgenerator.data.PeptideHlaMhcAffinity
|
203 |
init_args:
|
204 |
path: biomap-research/peptide_hla_mhc_affinity
|
205 |
class_filter: null
|