Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
franknoh committed Apr 18, 2024
1 parent 22c45d0 commit b45a561
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 41 deletions.
8 changes: 0 additions & 8 deletions data/test.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,6 @@ HLA-B-0702 LAAIANQAA 0.0
HLA-B-4002 PEVRIPVDL 0.0
HLA-A-3301 SQSDTVFDY 0.0
HLA-A-3002 VTSLAIKNY 0.0

HLA-A-2902 MIDEGATLY 0.0
H2-Kb NKVFRYILL 0.0
HLA-A-0201 KLLTDIASV 0.0
Expand Down Expand Up @@ -3229,7 +3228,6 @@ HLA-A-0205 FLFGEVHKA 0.0
H2-Db DLLFNKVTL 1.0
HLA-A-2407 SYNNKCIHL 0.0
HLA-A-0204 GTLSKIFKL 0.0

HLA-A-6801 STGVAEYLK 0.0
HLA-B-0702 YPAGRPNYV 0.0
HLA-A-3002 FSTSKLEGY 0.0
Expand Down Expand Up @@ -4646,7 +4644,6 @@ HLA-A-3303 GQYAVILAR 0.0
HLA-B-0702 GPIRFVLAL 1.0
HLA-A-0201 ILDEKPVII 1.0
HLA-B-4402 YEIWRDIDF 1.0

HLA-A-2407 LFSDRVQSF 0.0
H2-Db DKKNNKCLL 0.0
HLA-A-0250 CINSTATEV 1.0
Expand Down Expand Up @@ -4796,7 +4793,6 @@ HLA-A-3301 AVTPPPKPK 0.0
HLA-A-2402 EYLVSFGVW 1.0
HLA-A-6802 ETIPLTAEK 1.0
HLA-B-0801 MKTFLILAL 1.0

HLA-B-4002 KEDRIITIL 0.0
HLA-B-3701 PEDMHTDKF 0.0
HLA-B-4402 FEEDVKKEL 0.0
Expand Down Expand Up @@ -4903,7 +4899,6 @@ HLA-B-3701 DENTYAMEL 0.0
HLA-A-0301 LVTLPVYSK 1.0
HLA-A-1101 KLNSGIKTK 0.0
HLA-A-0301 KSFKDILPK 1.0

HLA-A-6801 GFTATICLK 0.0
HLA-B-5501 RPTASSDSL 0.0
HLA-A-2601 FDDLMIDLY 0.0
Expand Down Expand Up @@ -5480,7 +5475,6 @@ HLA-A-0101 FTGTISVMY 0.0
HLA-B-4402 GEELPLSAL 0.0
HLA-A-2601 EYDMVRLPY 0.0
HLA-A-3303 RVCGVSAAR 0.0

HLA-A-0201 SQVPEVTTV 0.0
HLA-B-2709 RRRWRRLTV 1.0
HLA-B-4002 DEKSPIYYF 0.0
Expand Down Expand Up @@ -8339,7 +8333,6 @@ HLA-B-5701 RSKSRSRSW 0.0
HLA-A-0101 KTDNDTILY 0.0
HLA-A-0206 FQGRGVFEL 1.0
HLA-A-6801 WVVGPLIGK 0.0

HLA-A-0101 VADETELPY 0.0
HLA-A-3303 LLHAINHPK 0.0
HLA-A-0201 WATESPIYV 1.0
Expand Down Expand Up @@ -9153,7 +9146,6 @@ HLA-A-2301 YTYFSNTIL 1.0
HLA-A-2407 MYQYIFLSF 0.0
HLA-A-2301 IYSTWPSTL 0.0
HLA-B-3501 KPIVQYDNF 1.0

H2-Kb IGVNSRVPL 0.0
H2-Db KLIVCAWAM 0.0
HLA-A-3201 ALFFFDIDL 1.0
Expand Down
20 changes: 0 additions & 20 deletions data/train.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -2136,7 +2136,6 @@ HLA-A-1101 PTLDIELLK 1.0
HLA-A-0201 GLKRGPSTE 0.0
HLA-A-0201 GLAPGLPSG 0.0
H2-Db GVITNAASM 0.0

HLA-B-5101 IPYQDLPHL 0.0
HLA-A-0201 LLGPRLVLA 0.0
H2-Kb LVSIFLHLV 0.0
Expand Down Expand Up @@ -2698,7 +2697,6 @@ H2-Db QAVANGGAI 1.0
H2-Ld LPSEIIYEI 0.0
HLA-B-4105 SPSGWSNVF 0.0
HLA-B-5101 KPMPKQREM 0.0

HLA-A-0203 TILLGIFFL 1.0
HLA-A-0201 AIHLYFLFV 0.0
HLA-B-5401 DPIFLLHHA 0.0
Expand Down Expand Up @@ -6093,7 +6091,6 @@ HLA-A-0301 SLYGPGTNR 0.0
HLA-B-4001 KELGLATEY 0.0
HLA-A-0201 ILKEYVHGV 0.0
H2-Dd GGPSTSGIA 0.0

HLA-A-0201 WLPFGFILI 1.0
HLA-B-0702 TPINLVRDL 0.0
HLA-B-4402 AEDSYGCTL 0.0
Expand Down Expand Up @@ -9090,7 +9087,6 @@ HLA-B-1501 SQFSYQHAI 0.0
H2-Kb LLMMYLMFL 0.0
HLA-A-6801 LVVESTYRK 0.0
HLA-B-0702 NPSVLKILL 1.0

HLA-A-0201 IMACVGFFL 0.0
HLA-A-3303 MSLRSTIIK 0.0
HLA-A-3303 SFLRKIGDK 0.0
Expand Down Expand Up @@ -10155,7 +10151,6 @@ HLA-A-0201 KIEEADKKT 0.0
HLA-A-1101 KSCALVFGR 0.0
H2-Dd IGPYIIGNI 1.0
HLA-B-5501 PPHGRSTIL 0.0

HLA-B-5701 LAKTGVHHY 0.0
HLA-A-0101 RQSPYAAGY 0.0
H2-Db FALVNAGAM 1.0
Expand Down Expand Up @@ -10301,7 +10296,6 @@ HLA-A-0201 YMWLGARYL 0.0
HLA-A-0201 MIIVSSCAV 0.0
HLA-A-2902 NSSIISLFY 0.0
HLA-A-0301 AYFQSSMTK 1.0

HLA-A-0206 GLAAAVVAV 1.0
HLA-B-0702 APTRVVASE 1.0
HLA-B-0702 CPKVSFEPI 0.0
Expand Down Expand Up @@ -12337,7 +12331,6 @@ HLA-B-4901 VEVEPGSSF 0.0
H2-Kd LYFCTKSFR 0.0
HLA-A-1101 SVISQLMKK 0.0
H2-Kb CCLCLTVFL 1.0

HLA-B-0702 AHVDKCLEL 1.0
HLA-A-2407 KYCLRAIKL 0.0
HLA-A-1101 PLPNYTFPR 0.0
Expand Down Expand Up @@ -12513,7 +12506,6 @@ HLA-A-0201 RYGSFSVTL 0.0
HLA-B-4001 QEVERALYL 0.0
H2-Kd AYCETCWEL 1.0
HLA-A-6801 LFVKKMLPK 0.0

HLA-A-2402 LYTAGDYHL 0.0
H2-Db IQLFSDFTI 0.0
HLA-A-2407 KYCVNLYII 0.0
Expand Down Expand Up @@ -12745,7 +12737,6 @@ HLA-B-5001 REIEEQLRA 0.0
HLA-A-2601 ETAIWSSRY 0.0
HLA-A-2902 GIADIRDKY 0.0
HLA-B-0702 LPSSLINDL 1.0

HLA-A-2407 YYQGSCYIL 0.0
HLA-A-2402 IWLGFIAGL 1.0
HLA-A-0301 GSNIVIFVK 0.0
Expand Down Expand Up @@ -13618,7 +13609,6 @@ H2-Db LAMATMDLI 0.0
HLA-A-0101 MSTYGWNIV 0.0
HLA-B-5501 MPIKSIVTL 0.0
HLA-A-2301 HFQRITLEL 0.0

HLA-A-2402 VMVTSKPLF 0.0
HLA-A-0201 LYAANNTRV 1.0
HLA-B-3503 SATEAFGEL 1.0
Expand Down Expand Up @@ -13834,9 +13824,7 @@ HLA-B-5701 KTIAEGRRI 0.0
HLA-B-5701 KTFTGHREW 0.0
HLA-B-5501 GPRYVLNAI 0.0
H2-Db TDVVNFVSM 0.0

HLA-B-5001 REIQQQRAA 0.0

HLA-A-2402 RYPIIDIKW 0.0
HLA-B-3701 METMFFIRF 0.0
HLA-A-0101 LSKKGYILY 0.0
Expand Down Expand Up @@ -14314,7 +14302,6 @@ HLA-B-5301 RPLYITLHL 0.0
H2-Kd FVNYNKTSI 0.0
HLA-B-3701 LEDLVPDKL 0.0
HLA-A-2407 HYGVNLNTL 0.0

HLA-A-2301 EYYNWDDEL 0.0
HLA-B-4403 DEIDLHALY 0.0
H2-Db NQLLARPFL 0.0
Expand Down Expand Up @@ -14623,7 +14610,6 @@ H2-Db DHVKNIENL 0.0
HLA-B-1501 AQRRTGPTQ 0.0
HLA-A-0101 NTYGEGFDY 0.0
HLA-A-2601 LSVPEYILY 0.0

HLA-B-0801 VPMEKLKTL 0.0
H2-Db IRHENRMVL 0.0
HLA-B-0702 EPLITKLIL 0.0
Expand Down Expand Up @@ -15922,7 +15908,6 @@ HLA-A-0201 LLQTLDGFV 0.0
HLA-A-2601 SMDSDDGFY 0.0
HLA-B-5301 IPDKFFIQL 0.0
HLA-A-2402 QYLALAALI 0.0

H2-Db MAKQSQTPL 0.0
H2-Kd VYYKNLQMI 0.0
HLA-A-0301 PVMSGNSYR 0.0
Expand Down Expand Up @@ -19565,7 +19550,6 @@ HLA-A-1101 AINSEMFLR 1.0
HLA-A-0201 TLYTAVSST 1.0
HLA-B-4901 EEIDNELDY 0.0
HLA-A-0201 VLFLLVIGA 0.0

HLA-A-6801 TFNRTHYWK 0.0
HLA-B-4001 LETDLRSEF 0.0
H2-Kb FNYILIIAL 0.0
Expand Down Expand Up @@ -20103,7 +20087,6 @@ HLA-B-4901 IENASKQNL 0.0
H2-Kb IVLIVITGI 0.0
HLA-B-0702 SPLYSVKSL 0.0
HLA-A-2402 YYSTAASSL 1.0

HLA-A-2407 KMSTDNAVY 0.0
HLA-A-0201 CINGACWTV 1.0
HLA-A-0201 GLYGGMEHL 0.0
Expand Down Expand Up @@ -20548,7 +20531,6 @@ H2-Kb GAYFIAMRL 0.0
HLA-A-0206 ALMVRQARG 1.0
HLA-A-0212 QLQVNLPHV 0.0
HLA-A-3303 QQLHVHNNR 0.0

HLA-B-0702 LPFGKTTIM 0.0
HLA-A-3002 YSNIMNERY 0.0
HLA-A-3301 GQYAVILAR 0.0
Expand Down Expand Up @@ -21229,7 +21211,6 @@ H2-Db MALLLPYTI 0.0
HLA-B-4001 KEMNRSIIY 0.0
HLA-B-0702 GPLKLFMAL 1.0
HLA-A-6801 SSEDIMFSK 0.0

HLA-B-1501 HQQPPSQQY 0.0
HLA-B-5001 RETEPPPKA 0.0
HLA-A-0301 AIFLSSMTK 1.0
Expand All @@ -21254,7 +21235,6 @@ HLA-B-5301 IPYLRNYMV 0.0
HLA-A-2301 YFSTQQNKL 0.0
HLA-A-0201 PVVSTHEQI 1.0
HLA-A-0201 KLSSFFQSV 0.0

HLA-B-4402 TELERFLEY 0.0
HLA-B-4402 EEGRGILIY 0.0
HLA-B-0702 SPGSGFWSF 1.0
Expand Down
4 changes: 2 additions & 2 deletions gptneo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from model import GPT, GPTConfig, GPTNeo
from dataset import MhcSeqDataset, Gpt2ClassificationCollator
from .model import GPT, GPTConfig, GPTNeo
from .dataset import MhcSeqDataset, Gpt2ClassificationCollator
2 changes: 1 addition & 1 deletion gptneo/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,4 @@ def from_pretrained(self, path):

def predict(self, idx):
logits, _ = self.forward(idx)
return logits.argmax(-1)
return logits
12 changes: 2 additions & 10 deletions train_tpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from torch.utils.data import DataLoader
from torch.optim import AdamW
from sklearn.metrics import accuracy_score
from gptneo import MhcSeqDataset, Gpt2ClassificationCollator, GPTNeo
from gptneo import MhcSeqDataset, Gpt2ClassificationCollator, GPTNeo, GPTConfig
from transformers import get_linear_schedule_with_warmup
from accelerate import Accelerator

Expand All @@ -30,15 +30,7 @@ def main(use_wandb=True):
"n_labels": n_labels
})

model = GPTNeo(config={
'vocab_size': 32,
'block_size': 384,
'n_embd': 256,
'n_layer': 12,
'n_head': 4,
'bias': True,
'dropout': 0.1
})
model = GPTNeo(GPTConfig)
model.to(device)
model.config.pad_token_id = 0
model.train()
Expand Down

0 comments on commit b45a561

Please sign in to comment.