It is late, but to answer, you could have used any loss function putting the loss weight to be 0. As an example,
model.compile(optimizer=..., loss=[realLossFunction, zeroLossFunction], loss_weights=[1.0, 0.0])