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.
| Variant | Num Layers | Hidden Size | Num Heads | Intermediate Size | Num Parameters (M) | FLOPs (G) | MACs (G) | Max Num Tokens |
|---|---|---|---|---|---|---|---|---|
| AMPLIFY-120M | 24 | 640 | 10 | 2560 | 118.67 | 137.34 | 68.58 | 2048 |
| AMPLIFY-350M | 32 | 960 | 15 | 3840 | 354.91 | 394.98 | 197.30 |
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/amplify-120m")
5output = predictor("MVLSPADKTNVKAAW<mask>KVGAHAGEYGAEALER")1from multimolecule import ProteinTokenizer, AmplifyModel
2
3
4tokenizer = ProteinTokenizer.from_pretrained("multimolecule/amplify-120m")
5model = AmplifyModel.from_pretrained("multimolecule/amplify-120m")
6
7text = "MVLSPADKTNVKAAWGKVGAHAGEYGAEALER"
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 ProteinTokenizer, AmplifyForSequencePrediction
3
4
5tokenizer = ProteinTokenizer.from_pretrained("multimolecule/amplify-120m")
6model = AmplifyForSequencePrediction.from_pretrained("multimolecule/amplify-120m")
7
8text = "MVLSPADKTNVKAAWGKVGAHAGEYGAEALER"
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 ProteinTokenizer, AmplifyForTokenPrediction
3
4
5tokenizer = ProteinTokenizer.from_pretrained("multimolecule/amplify-120m")
6model = AmplifyForTokenPrediction.from_pretrained("multimolecule/amplify-120m")
7
8text = "MVLSPADKTNVKAAWGKVGAHAGEYGAEALER"
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 ProteinTokenizer, AmplifyForContactPrediction
3
4
5tokenizer = ProteinTokenizer.from_pretrained("multimolecule/amplify-120m")
6model = AmplifyForContactPrediction.from_pretrained("multimolecule/amplify-120m")
7
8text = "MVLSPADKTNVKAAWGKVGAHAGEYGAEALER"
9input = tokenizer(text, return_tensors="pt")
10label = torch.randint(2, (len(text), len(text)))
11
12output = model(**input, labels=label)| chain separator.<mask>.1e-3, cosine-decayed to 1e-4.1e-4.(0.9, 0.95), weight decay 0.01, gradient clipping 1.0, mixed-precision bf16 with tf32, a total batch size of 4,096 sequences, and DeepSpeed ZeRO stage 3.1@article{Fournier2024.09.23.614603,
2 title = {Protein Language Models: Is Scaling Necessary?},
3 author = {Fournier, Quentin and Vernon, Robert M. and van der Sloot, Almer and Schulz, Benjamin and Chandar, Sarath and Langmead, Christopher James},
4 year = {2024},
5 journal = {bioRxiv},
6 publisher = {Cold Spring Harbor Laboratory},
7 doi = {10.1101/2024.09.23.614603},
8 url = {https://www.biorxiv.org/content/early/2024/09/23/2024.09.23.614603},
9}[!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