How to set a newtwork with two objectives?
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