Views
No views yet
[!CAUTION] The MultiMolecule team is aware of a potential risk in reproducing the results of RibonanzaNet.The original implementation of RibonanzaNet does not prepend<bos>(<cls>) and append<eos>tokens to the input sequence. This should not affect the performance of the model in most cases, but it can lead to unexpected behavior in some cases.Please setbos_token=None, cls_token=None, eos_token = Nonein the tokenizer and setbos_token_id=None, cls_token_id=None, eos_token_id=Nonein the model configuration if you want the exact behavior of the original implementation.
[!CAUTION] The MultiMolecule team is aware of a potential risk in reproducing the results of RibonanzaNet.The original implementation of RibonanzaNet applieddropout-residual-normpath twice to the output of the Self-Attention layer.By default, the MultiMolecule follows the original implementation.You can setfix_attention_residual=Truein the model configuration to apply thedropout-residual-normpath once.See more at issue #3
[!CAUTION] The MultiMolecule team is aware of a potential risk in reproducing the results of RibonanzaNet.The original implementation of RibonanzaNet does not apply attention mask correctly.By default, the MultiMolecule follows the original implementation.You can setfix_attention_mask=Truein the model configuration to apply the correct attention mask.
[!CAUTION] The MultiMolecule team is aware of a potential risk in reproducing the results of RibonanzaNet.The original implementation of RibonanzaNet applies dropout in an axis different from the one described in the paper.By default, the MultiMolecule follows the original implementation.You can setfix_pairwise_dropout=Truein the model configuration to follow the description in the paper.See more at issue #6
[!TIP] The MultiMolecule team has confirmed that the provided model and checkpoints are producing the same intermediate representations as the original implementation.
| Num Layers | Hidden Size | Num Heads | Intermediate Size | Num Parameters (M) | FLOPs (G) | MACs (G) | Max Num Tokens |
|---|---|---|---|---|---|---|---|
| 9 | 256 | 8 | 1024 | 11.37 | 755.42 | 372.81 | inf |
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("rna-secondary-structure", model="multimolecule/ribonanzanet-ss")
5output = predictor("GGUCUCUCUGGUUAGACCAGAUCUGAGCCU")1from multimolecule import RnaTokenizer, RibonanzaNetModel
2
3
4tokenizer = RnaTokenizer.from_pretrained("multimolecule/ribonanzanet")
5model = RibonanzaNetModel.from_pretrained("multimolecule/ribonanzanet")
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, RibonanzaNetForSequencePrediction
3
4
5tokenizer = RnaTokenizer.from_pretrained("multimolecule/ribonanzanet")
6model = RibonanzaNetForSequencePrediction.from_pretrained("multimolecule/ribonanzanet")
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, RibonanzaNetForTokenPrediction
3
4
5tokenizer = RnaTokenizer.from_pretrained("multimolecule/ribonanzanet")
6model = RibonanzaNetForTokenPrediction.from_pretrained("multimolecule/ribonanzanet")
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, RibonanzaNetForContactPrediction
3
4
5tokenizer = RnaTokenizer.from_pretrained("multimolecule/ribonanzanet")
6model = RibonanzaNetForContactPrediction.from_pretrained("multimolecule/ribonanzanet")
7
8text = "UAGCUUAUCAGACUGAUGUUG"
9input = tokenizer(text, return_tensors="pt")
10label = torch.randint(2, (len(text), len(text)))
11
12output = model(**input, labels=label)1@article{He2024.02.24.581671,
2 author = {He, Shujun and Huang, Rui and Townley, Jill and Kretsch, Rachael C. and Karagianes, Thomas G. and Cox, David B.T. and Blair, Hamish and Penzar, Dmitry and Vyaltsev, Valeriy and Aristova, Elizaveta and Zinkevich, Arsenii and Bakulin, Artemy and Sohn, Hoyeol and Krstevski, Daniel and Fukui, Takaaki and Tatematsu, Fumiya and Uchida, Yusuke and Jang, Donghoon and Lee, Jun Seong and Shieh, Roger and Ma, Tom and Martynov, Eduard and Shugaev, Maxim V. and Bukhari, Habib S.T. and Fujikawa, Kazuki and Onodera, Kazuki and Henkel, Christof and Ron, Shlomo and Romano, Jonathan and Nicol, John J. and Nye, Grace P. and Wu, Yuan and Choe, Christian and Reade, Walter and Eterna participants and Das, Rhiju},
3 title = {Ribonanza: deep learning of RNA structure through dual crowdsourcing},
4 elocation-id = {2024.02.24.581671},
5 year = {2024},
6 doi = {10.1101/2024.02.24.581671},
7 publisher = {Cold Spring Harbor Laboratory},
8 abstract = {Prediction of RNA structure from sequence remains an unsolved problem, and progress has been slowed by a paucity of experimental data. Here, we present Ribonanza, a dataset of chemical mapping measurements on two million diverse RNA sequences collected through Eterna and other crowdsourced initiatives. Ribonanza measurements enabled solicitation, training, and prospective evaluation of diverse deep neural networks through a Kaggle challenge, followed by distillation into a single, self-contained model called RibonanzaNet. When fine tuned on auxiliary datasets, RibonanzaNet achieves state-of-the-art performance in modeling experimental sequence dropout, RNA hydrolytic degradation, and RNA secondary structure, with implications for modeling RNA tertiary structure.Competing Interest StatementStanford University is filing patent applications based on concepts described in this paper. R.D. is a cofounder of Inceptive.},
9 url = {https://www.biorxiv.org/content/early/2024/06/11/2024.02.24.581671},
10 eprint = {https://www.biorxiv.org/content/early/2024/06/11/2024.02.24.581671.full.pdf},
11 journal = {bioRxiv}
12}[!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