I am using Kears with tensorflow and I have a model with 3 output out of which I only want to train 2.
model = Model(input=input, output=[out1,out2,out3])
model.compile(loss=[loss1, loss2, loss3], optimizer=my_optimizer)
loss1(y_true, y_pred):
return calculate_loss1(y_true, y_pred)
loss2(y_true, y_pred):
return calculate_loss2(y_true, y_pred)
loss3(y_true, y_pred):
return 0.0*K.mean(y_pred)
I tried to do it with the code above but I am not sure it does what I want do do. So I think it adds up the losses and it trains each output with that loss meanwhile I do not wish to train out3
at all. (I need out3
because it is used in testing). Could anybody tell me how to achieve this or reassure me that the code actually dose what I want?