0
$\begingroup$

I am learning TensorFlow 2.0, whose layer functions are based on Keras. What is the difference between the Concatenate() and concatenate() layers?

$\endgroup$
1
$\begingroup$

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)
$\endgroup$
1
$\begingroup$

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/

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.