yaringal / multi-task-learning-example

A multi-task learning example for the paper https://arxiv.org/abs/1705.07115
MIT License
843 stars 207 forks source link

Any way to incorporate these methods in other tasks easily? #7

Open Jacobew opened 5 years ago

Jacobew commented 5 years ago

Hi, thanks for your excellent job! I wonder is there any way to easily incorporate this method into other multi-tasks learning pipeline? I'm still trying to understanding the formulas and have no idea where I can obtain a noise scalar for each task. Looking forward to your reply :)

tamaraalshekhli commented 4 years ago

@Jacobew Hi, I have the same problem did you figure out how to solve it ?

mikael10j commented 4 years ago

Hi @Jacobew and @tamaraalshekhli , the task noise is an additional trainable parameter, although not an additional output of your network. What makes it the noise is the computation of the loss detailed in the paper and implemented on this github.

tamaraalshekhli commented 4 years ago

@mikael10j , thank you for your reply, I found difficulties to make this implementation works with my pipeline, did you managed to make it works for you? sorry for my basic question but Im kind of new on the deep learning and im facing a lot of difficulties to make my MT network working.

mikael10j commented 4 years ago

@tamaraalshekhli , if you use TF, it should be straightforward as every thing is described in Y. Gal's notebook.

tamaraalshekhli commented 4 years ago

@mikael10j thank you for your reply, im using keras and TF as abackend, please correct me if im wrong, according to the cod i need to define two models one predicting model and the other one is suppose to be similar but this one suppose to be trained, and implementing the loss as a layer at the out put layer of the model?

mikael10j commented 4 years ago

@tamaraalshekhli I'm not familiar with Keras (I use PyTorch), but if I understand correctly, get_prediction_model defines the model that learns to reconstruct the data and get_trainable_model combines the output of the model and the custom multi loss that learns the logvars. Imo you don't need to follow the same strategy, the important part to understand is the CustomMultiLossLayer. Again I'm not a specialist of Keras.

tamaraalshekhli commented 4 years ago

@mikael10j thank you very much for your help, have you tried to train you MT model with different loss ? when i used for example binary cross entropy ( binary segmentation task) the model gave me good predictions for one task and a very bad predictions for the other one even when i tried different values for the weight loss