Suppose I have a x_train, y1_train and y2_train.

I want to construct a network (such as simple MLP) to fit y1_train and to be low correlated with y2_train (or to fit -y2_train) simultaneously.

How could I achieve this goal? Is the custom loss function a good solution?

I use keras as my tool.


So this problem is less of a Deep learning problem and more of a logical problem. Your y1_train and y2_train can be modelled along with a pointer label that points what output to be considered in the output. Lets say we create the concatenated output as follows:

[[0/1],[y1_train], [y2_train]] 

Where 0 could represent weather the label to be selected is y1 or y2 and so on.

But if you are planning to create a little more complex output and train different outputs on different loss functions, here is an article you should refer to Multiple output tutorial/examples and Custom Loss Function for Unequal Weighted Multiple-Output Node Regression


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.