Difference between add and concatenate in keras

Difference between add and concatenate in keras . And where to apply which one…

Hey @dibakarchaudhary58, add layer takes input takes as input a list of tensors, all of the same shape, and returns a single tensor (also of the same shape).

Whereas, concatenate layer takes as input a list of tensors, all of the same shape except for the concatenation axis, and returns a single tensor, the concatenation of all inputs.

Hope this resolved your doubt.
Plz mark the doubt as resolved in my doubts section. :blush:

when would I use one over the other?

Hey @dibakarchaudhary58, you need to try and implement that, sometimes one layer works othertime other layer works. That completely depends on your architecture of the model. You are free to design any structure.

1 Like