A computer program product embedded in a non-transitory computer-readable medium comprising instructions executable by a computer processor for predicting major histocompatibility complex (MHC)-peptide binding affinity, which, when executed by a processor, cause the processor to perform one or more steps comprising:
- obtaining a plurality of training peptide sequences;
- configuring a neural network model to be trained to predict major histocompatibility complex (MHC)-peptide binding affinity using the plurality of training peptide sequences, wherein configuring the neural network model comprises configuring an encoder of the neural network model comprising a recurrent neural network (RNN) to process an input training peptide sequence to generate a fixed-dimension encoding output by applying a final hidden state of the RNN at intermediate state outputs of the RNN to generate attention weighted outputs, and linearly combining the attention weighted outputs;
- training the neural network model using the plurality of training peptide sequences;
- and
- configuring a computing device to use the trained neural network model to predict MHC-peptide binding affinity for a test peptide sequence.