Views
No views yet
[!TIP] The MultiMolecule team has confirmed that the provided model and checkpoints are producing the same intermediate representations as the original implementation.
| Variants | Num Layers | Hidden Size | Num Heads | Intermediate Size | Num Parameters (M) | FLOPs (G) | MACs (G) | Max Num Tokens |
|---|---|---|---|---|---|---|---|---|
| mRNA-FM | 12 | 1280 | 20 | 5120 | 239.26 | 258.08 | 128.85 | 1024 |
| RNA-FM | 640 | 99.52 | 109.02 | 54.36 |
multimolecule library. You can install it using pip:pip install multimolecule1import multimolecule # you must import multimolecule to register models
2from transformers import pipeline
3
4predictor = pipeline("fill-mask", model="multimolecule/rnafm")
5output = predictor("gguc<mask>cucugguuagaccagaucugagccu")1from multimolecule import RnaTokenizer, RnaFmModel
2
3
4tokenizer = RnaTokenizer.from_pretrained("multimolecule/rnafm")
5model = RnaFmModel.from_pretrained("multimolecule/rnafm")
6
7text = "UAGCUUAUCAGACUGAUGUUG"
8input = tokenizer(text, return_tensors="pt")
9
10output = model(**input)[!NOTE] This model is not fine-tuned for any specific task. You will need to fine-tune the model on a downstream task to use it for sequence classification or regression.
1import torch
2from multimolecule import RnaTokenizer, RnaFmForSequencePrediction
3
4
5tokenizer = RnaTokenizer.from_pretrained("multimolecule/rnafm")
6model = RnaFmForSequencePrediction.from_pretrained("multimolecule/rnafm")
7
8text = "UAGCUUAUCAGACUGAUGUUG"
9input = tokenizer(text, return_tensors="pt")
10label = torch.tensor([1])
11
12output = model(**input, labels=label)[!NOTE] This model is not fine-tuned for any specific task. You will need to fine-tune the model on a downstream task to use it for token classification or regression.
1import torch
2from multimolecule import RnaTokenizer, RnaFmForTokenPrediction
3
4
5tokenizer = RnaTokenizer.from_pretrained("multimolecule/rnafm")
6model = RnaFmForTokenPrediction.from_pretrained("multimolecule/rnafm")
7
8text = "UAGCUUAUCAGACUGAUGUUG"
9input = tokenizer(text, return_tensors="pt")
10label = torch.randint(2, (len(text), ))
11
12output = model(**input, labels=label)[!NOTE] This model is not fine-tuned for any specific task. You will need to fine-tune the model on a downstream task to use it for contact classification or regression.
1import torch
2from multimolecule import RnaTokenizer, RnaFmForContactPrediction
3
4
5tokenizer = RnaTokenizer.from_pretrained("multimolecule/rnafm")
6model = RnaFmForContactPrediction.from_pretrained("multimolecule/rnafm")
7
8text = "UAGCUUAUCAGACUGAUGUUG"
9input = tokenizer(text, return_tensors="pt")
10label = torch.randint(2, (len(text), len(text)))
11
12output = model(**input, labels=label)RnaTokenizer][multimolecule.RnaTokenizer] will convert "T"s to "U"s for you, you may disable this behaviour by passing replace_T_with_U=False.<mask> for 80% of masked tokens1@article{chen2022interpretable,
2 title={Interpretable rna foundation model from unannotated data for highly accurate rna structure and function predictions},
3 author={Chen, Jiayang and Hu, Zhihang and Sun, Siqi and Tan, Qingxiong and Wang, Yixuan and Yu, Qinze and Zong, Licheng and Hong, Liang and Xiao, Jin and King, Irwin and others},
4 journal={arXiv preprint arXiv:2204.00300},
5 year={2022}
6}[!NOTE] The artifacts distributed in this repository are part of the MultiMolecule project. If MultiMolecule supports your research, please cite the MultiMolecule project as follows:
1@software{chen_2024_12638419,
2 author = {Chen, Zhiyuan and Zhu, Sophia Y.},
3 title = {MultiMolecule},
4 doi = {10.5281/zenodo.12638419},
5 publisher = {Zenodo},
6 url = {https://doi.org/10.5281/zenodo.12638419},
7 year = 2024,
8 month = may,
9 day = 4
10}SPDX-License-Identifier: AGPL-3.0-or-later