# How do I format task features with a one-hot task identification vector to ensure separate weight matrices for each task in multi-task RL?

I am on Lecture 2 of Stanford CS330 Multi-Task and Meta-learning, and on slide 10, the professor describes using a one-hot input vector to represent the task, and she also explained that there would be independent weight matrices for each task

How is the input to a multi-task network encoded to allow the features of all the tasks to be associated with different weights?

Would you have an input vector containing all the features for every task, and then multiply the input vectors by the task ID vector? Is there a more efficient way to approach this problem?

In other terms, here’s what I’m thinking:

network_input[i] = features[i] * task[i]


where features is a 2d matrix of feature vectors for every task, and task is a one-hot vector corresponding to the task number. Is that multiplicative conditioning?

• I provided a link to the supposed lecture 2 of that course. Make sure that's the correct link. Also, maybe, to confirm, you could say which slide says what you say the professor says.
– nbro
Apr 10 '20 at 14:53
• Done. Thanks a lot. Apr 10 '20 at 16:15