ShuxianZou
commited on
Commit
•
a7d67c5
1
Parent(s):
7f4d028
Update README.md
Browse files
README.md
CHANGED
@@ -8,10 +8,22 @@ AIDO.RNA is an RNA foundation model trained on 42 million non-coding RNA sequenc
|
|
8 |
## How to Use
|
9 |
|
10 |
### Sequence-level Regression
|
11 |
-
|
12 |
|
13 |
### Sequence-level Classification
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
### Pairwise Token-level Classification
|
17 |
TODO
|
|
|
8 |
## How to Use
|
9 |
|
10 |
### Sequence-level Regression
|
11 |
+
|
12 |
|
13 |
### Sequence-level Classification
|
14 |
+
```
|
15 |
+
import torch
|
16 |
+
from genbio_finetune.tasks import SequenceClassification
|
17 |
+
from genbio_finetune.models import MLPPoolAdapter
|
18 |
+
model = SequenceClassification.from_config({"model.backbone": "rnafm",
|
19 |
+
"model.n_classes": 2,
|
20 |
+
"model.adapter": MLPPoolAdapter,
|
21 |
+
})
|
22 |
+
collated_batch = model.collate({"sequences": ["ACGT", "ACGT"]})
|
23 |
+
logits = model(collated_batch)
|
24 |
+
print(logits)
|
25 |
+
print(torch.argmax(logits, dim=-1))
|
26 |
+
```
|
27 |
|
28 |
### Pairwise Token-level Classification
|
29 |
TODO
|