Downloads · 30 days
7
5% of all-time downloads
wabu/AmpGPT2
AmpGPT2 is a machine learning model from wabu. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
AmpGPT2 is a language model capable of generating de novo antimicrobial peptides (AMPs). Over 95% of sequences generated by AmpGPT2 are predicted to have antimicrobial activities.
Downloads · 30 days
7
5% of all-time downloads
All-time downloads
154
Public
Parameters
774M
3.1 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors3.1 GB · 100%
From the Hugging Face model README
AmpGPT2 is a language model capable of generating de novo antimicrobial peptides (AMPs). Over 95% of sequences generated by AmpGPT2 are predicted to have antimicrobial activities.
AmpGPT2 is a fine-tuned version of nferruz/ProtGPT2 based on the GPT2 Transformer architecture.
| Model | sequences generated | AMP percentage (AMP%) | average length |
|---|---|---|---|
| AmpGPT2 | 1000 | 95.86 | 64.08 |
| ProtGPT2 | 1000 | 51.85 | 222.59 |
The results demonstrate that AmpGPT2 outperformes ProtGPT2 in AMP%, suggesting the model learned from the AMP-specific data.
To validate the results the Antimicrobial Peptide Scanner vr.2 (https://www.dveltri.com/ascan/v2/ascan.html) was used, which is a deep learning tool specifically designed for AMP recognition.
AmpGPT2 was trained using 32014 AMP sequences from the Compass (https://compass.mathematik.uni-marburg.de/) database.
The example code below contains the ideal generation settings found while testing. The 'num_return_sequences' parameter specifies the amount of sequences generated. When generating more than 100 sequences at the same time, I recommend doing it in batches. The results can then be checked with the peptide scanner.
from transformers import pipeline
from transformers import GPT2LMHeadModel, GPT2Tokenizer
ampgpt2 = pipeline('text-generation', model="wabu/AmpGPT2")
model_amp = GPT2LMHeadModel.from_pretrained('wabu/AmpGPT2')
tokenizer_amp = GPT2Tokenizer.from_pretrained('wabu/AmpGPT2')
amp_sequences = ampgpt2( "", do_sample=True, repetition_penalty=1.2, num_return_sequences=10, eos_token_id=0 )
for i, seq in enumerate(amp_sequences):
sequence_identifier = f"Sequence_{i + 1}"
sequence = seq['generated_text'].replace('','').strip()
print(f">{sequence_identifier}\n{sequence}")
The following hyperparameters were used during training:
| Training Loss | Epoch | Validation Loss | Accuracy |
|---|---|---|---|
| 3.7948 | 50.0 | 3.9890 | 0.4213 |
The model was trained on four NVIDIA A100 GPUs.