Multitask model for text (sentence) classification using PyTorch

Dear all,

I am a beginner in PyTorch and am looking to write a multitask model to optimize two text classification tasks, one being a binary classification and the other being a three-class classification. Can someone help me with a starting point reference (an example running code, tutorial etc.)? I have used Text CNN for binary and multi-class text classification. However, I find Multi Task Learning (MTL) difficult. I think that in the neural model, the MTL loss will be some combination (e.g. sum) of the individual task losses. However, I am unable to proceed further. I am curious to know how the MTL backpropagation is implemented, how the common layers are shared between the tasks etc.

Thanks in advance.