DianLiI commited on
Commit
cd78944
·
verified ·
1 Parent(s): 7890149

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +47 -1
README.md CHANGED
@@ -4,4 +4,50 @@ base_model:
4
  ---
5
  # AIDO.RNA 650M CDS
6
 
7
- AIDO.RNA 650M CDS is a domain adaptation model on the coding sequences. It was pre-trained on 9 million coding sequences starting with the AIDO.RNA 650M model.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  ---
5
  # AIDO.RNA 650M CDS
6
 
7
+ AIDO.RNA 650M CDS is a domain adaptation model on the coding sequences. It was pre-trained on 9 million coding sequences starting with the AIDO.RNA 650M model.
8
+
9
+ ## How to Use
10
+ ### Build any downstream models from this backbone
11
+ #### Embedding
12
+ ```python
13
+ from genbio_finetune.tasks import Embed
14
+ model = Embed.from_config({"model.backbone": "rnafm_650m_cds"}).eval()
15
+ collated_batch = model.collate({"sequences": ["ACGT", "AGCT"]})
16
+ embedding = model(collated_batch)
17
+ print(embedding.shape)
18
+ print(embedding)
19
+ ```
20
+ #### Sequence Level Classification
21
+ ```python
22
+ import torch
23
+ from genbio_finetune.tasks import SequenceClassification
24
+ model = SequenceClassification.from_config({"model.backbone": "rnafm_650m_cds", "model.n_classes": 2}).eval()
25
+ collated_batch = model.collate({"sequences": ["ACGT", "AGCT"]})
26
+ logits = model(collated_batch)
27
+ print(logits)
28
+ print(torch.argmax(logits, dim=-1))
29
+ ```
30
+ #### Token Level Classification
31
+ ```python
32
+ import torch
33
+ from genbio_finetune.tasks import TokenClassification
34
+ model = TokenClassification.from_config({"model.backbone": "rnafm_650m_cds", "model.n_classes": 3}).eval()
35
+ collated_batch = model.collate({"sequences": ["ACGT", "AGCT"]})
36
+ logits = model(collated_batch)
37
+ print(logits)
38
+ print(torch.argmax(logits, dim=-1))
39
+ ```
40
+ #### Regression
41
+ ```python
42
+ from genbio_finetune.tasks import SequenceRegression
43
+ model = SequenceRegression.from_config({"model.backbone": "rnafm_650m_cds"}).eval()
44
+ collated_batch = model.collate({"sequences": ["ACGT", "AGCT"]})
45
+ logits = model(collated_batch)
46
+ print(logits)
47
+ ```
48
+ #### Or use our one-liner CLI to finetune or evaluate any of the above!
49
+ ```
50
+ gbft fit --model SequenceClassification --model.backbone rnafm_650m_cds --data SequenceClassification --data.path <hf_or_local_path_to_your_dataset>
51
+ gbft test --model SequenceClassification --model.backbone rnafm_650m_cds --data SequenceClassification --data.path <hf_or_local_path_to_your_dataset>
52
+ ```
53
+ For more information, visit: [Model Generator](https://github.com/genbio-ai/modelgenerator)