Progen
1.0.0

تنفيذ السلالة في Pytorch ، من الورقة "Progen: نمذجة اللغة لتوليد البروتين"
GPT لتسلسل البروتينات
رابط الورق
pip install progen-torch
import torch
from progen . model import ProGen
x = torch . randint ( 0 , 100 , ( 1 , 1024 ))
# Initialize the model with specific parameters
model = ProGen (
num_tokens = 100 , # The size of the vocabulary
dim = 512 , # The dimension of the embeddings
seq_len = 1024 , # The length of the sequences
depth = 6 , # The number of layers in the model
window_size = 256 , # The size of the window for local attention
global_mlp_depth = 2 , # The depth of the MLP in the global attention mechanism
heads = 8 , # The number of attention heads
dim_head = 512 , # The dimension of each attention head
ff_mult = 4 , # The multiplier for the feed-forward network's hidden layer size
ff_glu = True , # Whether to use a GLU activation in the feed-forward network
attn_dim = None , # The dimension of the attention mechanism (None means it defaults to `dim`)
clamp_gate = True , # Whether to clamp the gate values in the GLU activation
shift_tokens = True , # Whether to shift the tokens for the causal attention mechanism
dropout = 0.1 , # The dropout rate
)
# Forward pass through the model
logits = model ( x )
# The output is the logits for each token in the vocabulary, for each position in the input sequences
# Shape: (batch_size, sequence_length, num_tokens)
print ( logits . shape ) # Should print: torch.Size([1, 1024, 100])
فيما يلي جدول لمجموعات البيانات المستخدمة في الورقة مع روابط البيانات الوصفية ومصدر:
| مجموعة البيانات | وصف | مصدر |
|---|---|---|
| unip | يحتوي على تسلسل البروتين من مصادر مختلفة | https://www.uniprot.org/uniparc/ |
| uniprotkb | يحتوي على تسلسل البروتين والتعليقات التوضيحية | https://www.uniprot.org/uniprot/ |
| سويسري | قاعدة بيانات تسلسل البروتين المنسق | https://www.uniprot.org/swiss-prot/ |
| تريبل | تسلسل البروتين المحاسبي | https://www.uniprot.org/trembl/ |
| PFAM | قاعدة بيانات عائلات البروتين | https://pfam.xfam.org/ |
| NCBI التصنيف | تصنيف التصنيف للكائنات الحية | https://www.ncbi.nlm.nih.gov/taxonomy |
فيما يلي رسم بياني يوضح تدفق المعالجة المسبقة للبيانات:
الرسم البياني TD
A [uniparc] -> B [مرشح ودمج]
C [uniprotkb] -> ب
D [Swiss-Prot]-> Be [Trembl]-> B.
F [PFAM] -> ب
G [تصنيف NCBI] -> ب
ب -> ح [تقسيم القطار/الاختبار]
H -> أنا [مجموعة القطار]
H -> J [مجموعة اختبار المعرف]
H -> K [مجموعة اختبار OOD]
يتم ترشيح مجموعات بيانات التصنيف Uniparc و Uniprotkb و Swiss-Prot و Trembl و PFAM و NCBI ودمجها في الخطوة ب.
معهد ماساتشوستس للتكنولوجيا