I am learning TensorFlow 2.0, whose layer functions are based on Keras. What is the difference between the Concatenate()
and concatenate()
layers?
2 Answers
Keras provides 2 kinds of API i.e. Sequential and Functional. And because of this 2 kind of API, the difference is there in them.
- Concatenate is used when you are using Sequential API
- concatenate is used when you are using Functional API
Just look into the following documentation: https://keras.io/layers/merge/
Keras has two basic organizational modes: "Sequential" and "Functional". concatenate
is the functional version, and really just wraps the Concatenate
layer.
from source: https://github.com/keras-team/keras/blob/master/keras/layers/merge.py#L638
def concatenate(inputs, axis=-1, **kwargs):
"""...snip documentation..."""
return Concatenate(axis=axis, **kwargs)(inputs)