C3W3 Assignment: Why concatenate?

In Siamese model, why do we concatenate the model outputs and then split them again to calculate the loss? Why doesn’t the model simply output two separate vectors instead? It seems that the concatenation step is unnecessary.
I mean this
return tf.keras.models.Model(inputs=[input1, input2], outputs=[branch1, brach2], name="SiameseModel")
intead of this
return tf.keras.models.Model(inputs=[input1, input2], outputs=conc, name="SiameseModel")

Thank you for your response!

Concatenation is not strictly necessary, but it simplifies the model structure, and makes training workflows smoother. If you don’t concatenate, then you may have to define a custom loss function that will handle the two different vectors/tensors. Concatenating will enable you to define the loss function within the model itself. It is easier to handle the code when the model has one output.
If you’re comfortable handling separate outputs, you can return two vectors and define the loss externally.