Views
No views yet
ANKH-Large model and was pretrained on a large corpus of protein sequences in a self-supervised fashion.
This means it was pretrained on the raw protein sequences only, with no humans labelling them in any way (which is why it can use lots of
publicly available data) with an automatic process to generate inputs and labels from those protein sequences.1sequence_examples = ["PRTEINO", "SEQWENCE"]
2# tokenize sequences and pad up to the longest sequence in the batch
3ids = tokenizer.batch_encode_plus(sequence_examples, add_special_tokens=True, padding="longest")
4input_ids = torch.tensor(ids['input_ids']).to(device)
5attention_mask = torch.tensor(ids['attention_mask']).to(device)
6# generate embeddings
7with torch.no_grad():
8 embedding_repr = model(input_ids=input_ids,attention_mask=attention_mask)
9# extract embeddings for the first ([0,:]) sequence in the batch while removing padded & special tokens ([0,:7])
10emb_0 = embedding_repr.last_hidden_state[0,:7] # shape (7 x 1536)
11print(f"Shape of per-residue embedding of first sequences: {emb_0.shape}")
12# do the same for the second ([1,:]) sequence in the batch while taking into account different sequence lengths ([1,:8])
13emb_1 = embedding_repr.last_hidden_state[1,:8] # shape (8 x 1536)
14# if you want to derive a single representation (per-protein embedding) for the whole protein
15emb_0_per_protein = emb_0.mean(dim=0) # shape (1536)
16print(f"Shape of per-protein embedding of first sequences: {emb_0_per_protein.shape}")Protein Sequence </s><extra_id_num> token, where "num" is a number in range 0 and 115.| Task/Dataset | Method | secondary structure (3-states) | secondary structure (8-states) | Localization | Membrane | Solubility | Fluorescence |
|---|---|---|---|---|---|---|---|
| CASP12 | FE | comming soon | comming soon | ||||
| CASP12 | Lora | comming soon | comming soon | ||||
| TS115 | FE | comming soon | comming soon | ||||
| TS115 | Lora | comming soon | comming soon | ||||
| CB513 | FE | comming soon | comming soon | ||||
| CB513 | Lora | comming soon | comming soon | ||||
| DeepLoc | FE | comming soon | comming soon | ||||
| DeepLoc | Lora | comming soon | comming soon | ||||
| Solubility | FE | comming soon | |||||
| Solubility | Lora | 74% | |||||
| Fluorescence | FE | Comming Soon | |||||
| Fluorescence | Lora | 68% |
1@article{elnaggar2023ankh,
2 title={Ankh☥: Optimized protein language model unlocks general-purpose modelling},
3 author={Elnaggar, Ahmed and Essam, Hazem and Salah-Eldin, Wafaa and Moustafa, Walid and Elkerdawy, Mohamed and Rochereau, Charlotte and Rost, Burkhard},
4 journal={bioRxiv},
5 pages={2023--01},
6 year={2023},
7 publisher={Cold Spring Harbor Laboratory}
8}Created by Ahmed Elnaggar/@Elnaggar_AI | LinkedIn