Code Monkey home page Code Monkey logo

Comments (2)

AvivNavon avatar AvivNavon commented on June 11, 2024

Hi @pcheng2
If I understand correctly the code you provided, you do not share parameters between the different tasks. For example, the second_model is only used to predict the "m" task, and the third_model is only used to predict the "n" task. In that case all parameters are tasks specific and so no MTL method is needed (you are basically doing single task learning in parallel for several tasks). If the tasks are related in any way, consider using a shared module (shared_model) to map x into features z which will than be feed into the task specific modules (first_model, second_model, ...). In that case the parameters of the shared_model are the shared_parameters and all other params are the task_specific_parameters.
Hope that helps

from nash-mtl.

pcheng2 avatar pcheng2 commented on June 11, 2024

Hi @AvivNavon,

Thank you so much for your replying! I'm sorry for the confusion about the question because I'm literally not quite familiar with MTL and based on your patient explanation, I'm more confident that I was misunderstanding the problem settings in MTL.

In my practical work, I will get different loss terms (approx. 8) from various modules(encoder-decoder and some feed-foward models), and backpropagate these losses to the modules' parameters. The problem is that I found these loss terms have different scales, thus the whole module may overfit in some direction where other losses are not converged yet. And my current solution is to manullay assign different weights on these terms.

Therefore, I was wrongly thought I might encounter an MTL problem, and try to find a method to automatically allocate the weights of these loss terms and their gradients. While in my case, each model is doing 'single task learning', there is no parameter/module sharing between them. I'll try your advice about using a shared module with different task-specific modules.

And for MTL tasks, I'm wondering that is it a necessary condition for the model to have various heads (usually at the last layer and with identical logits as input) regard to the task number?

Anyway, thank you so much for your kind response and suggestion, I'll try it out!

from nash-mtl.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.