Upload folder using huggingface_hub
Browse files- README.md +58 -0
- config.json +54 -0
- pytorch_model.bin +3 -0
README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: tedbench
|
| 3 |
+
tags:
|
| 4 |
+
- protein
|
| 5 |
+
- sequence
|
| 6 |
+
- fold-classification
|
| 7 |
+
- tedbench
|
| 8 |
+
- esm2
|
| 9 |
+
pipeline_tag: other
|
| 10 |
+
license: bsd-3-clause
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# TEDBench — ESM2-650M fine-tuned on TEDBench
|
| 14 |
+
|
| 15 |
+
Backbone: [ESM2-650M](https://huggingface.co/facebook/esm2_t33_650M_UR50D) (33 layers, hidden dim 1280).
|
| 16 |
+
|
| 17 |
+
Fine-tuned on [TEDBench](https://github.com/BorgwardtLab/TEDBench) for protein
|
| 18 |
+
fold classification into 965 CATH topology (T-level) classes (ICML 2026).
|
| 19 |
+
|
| 20 |
+
## Usage
|
| 21 |
+
|
| 22 |
+
```python
|
| 23 |
+
import sys
|
| 24 |
+
sys.path.insert(0, "baselines") # from repo root
|
| 25 |
+
|
| 26 |
+
from pathlib import Path
|
| 27 |
+
import torch
|
| 28 |
+
from models.esm2_classifier import ESM2Classifier
|
| 29 |
+
from omegaconf import OmegaConf
|
| 30 |
+
from huggingface_hub import snapshot_download
|
| 31 |
+
|
| 32 |
+
local_dir = Path(snapshot_download("TEDBench/esm2-650M-ft"))
|
| 33 |
+
with open(local_dir / "config.json") as f:
|
| 34 |
+
import json
|
| 35 |
+
cfg = OmegaConf.create(json.load(f))
|
| 36 |
+
|
| 37 |
+
model = ESM2Classifier(cfg)
|
| 38 |
+
sd = torch.load(local_dir / "pytorch_model.bin", map_location="cpu", weights_only=False)
|
| 39 |
+
model.load_state_dict(sd)
|
| 40 |
+
model.eval()
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
Or pass the repo ID directly to the test script:
|
| 44 |
+
|
| 45 |
+
```bash
|
| 46 |
+
python baselines/esm2_test_ted.py train.ckpt_path=TEDBench/esm2-650M-ft
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
## Citation
|
| 50 |
+
|
| 51 |
+
```bibtex
|
| 52 |
+
@inproceedings{chen2026tedbench,
|
| 53 |
+
title={Protein Fold Classification at Scale: Benchmarking and Pretraining},
|
| 54 |
+
author={Chen, Dexiong and Manolache, Andrei and Niepert, Mathias and Borgwardt, Karsten},
|
| 55 |
+
booktitle={Proceedings of the 43rd International Conference on Machine Learning},
|
| 56 |
+
year={2026}
|
| 57 |
+
}
|
| 58 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"seed": 42,
|
| 3 |
+
"wandb": true,
|
| 4 |
+
"truncation_seq_length": 512,
|
| 5 |
+
"batch_size": 16,
|
| 6 |
+
"datamodule": {
|
| 7 |
+
"batch_size": 64,
|
| 8 |
+
"num_workers": 32,
|
| 9 |
+
"_target_": "foldmae.data.TEDLightningDataset",
|
| 10 |
+
"root": "./datasets/afdb_FS_plddt80",
|
| 11 |
+
"dataset_name": "ted"
|
| 12 |
+
},
|
| 13 |
+
"trainer": {
|
| 14 |
+
"_target_": "pytorch_lightning.Trainer",
|
| 15 |
+
"accelerator": "auto",
|
| 16 |
+
"max_steps": 18300,
|
| 17 |
+
"strategy": "ddp_find_unused_parameters_true",
|
| 18 |
+
"devices": "auto",
|
| 19 |
+
"default_root_dir": "${logs.path}",
|
| 20 |
+
"num_sanity_val_steps": 0,
|
| 21 |
+
"accumulate_grad_batches": 16
|
| 22 |
+
},
|
| 23 |
+
"model": {
|
| 24 |
+
"name": "esm2_t33_650M_UR50D",
|
| 25 |
+
"num_classes": 965,
|
| 26 |
+
"avg_pool": false
|
| 27 |
+
},
|
| 28 |
+
"train": {
|
| 29 |
+
"optimizer": {
|
| 30 |
+
"_target_": "torch.optim.AdamW",
|
| 31 |
+
"lr": 0.0016,
|
| 32 |
+
"weight_decay": 0.1,
|
| 33 |
+
"betas": [
|
| 34 |
+
0.9,
|
| 35 |
+
0.95
|
| 36 |
+
]
|
| 37 |
+
},
|
| 38 |
+
"lr_scheduler": {
|
| 39 |
+
"_target_": "foldmae.lr_schedulers.get_cosine_schedule_with_warmup",
|
| 40 |
+
"warmup_steps": 1830,
|
| 41 |
+
"max_steps": "${trainer.max_steps}"
|
| 42 |
+
},
|
| 43 |
+
"loss": {
|
| 44 |
+
"_target_": "torch.nn.CrossEntropyLoss"
|
| 45 |
+
},
|
| 46 |
+
"llrd": 0.8,
|
| 47 |
+
"ckpt_path": "logs/esm2/finetune/ted/42/runs/2026-01-20_07-59-12/model.ckpt"
|
| 48 |
+
},
|
| 49 |
+
"logs": {
|
| 50 |
+
"prefix": "logs/esm2/finetune/${datamodule.dataset_name}/${seed}",
|
| 51 |
+
"path": "${logs.prefix}/runs/${now:%Y-%m-%d}_${now:%H-%M-%S}"
|
| 52 |
+
},
|
| 53 |
+
"_model_class": "esm2"
|
| 54 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ded12b858ce72769546cf9f26c0a4c359e409770d50e4f58eff7e5eb584b8b16
|
| 3 |
+
size 2609324119
|