0

Please tell me what it means if there are two () in Flatten as shown below. Thank you.

conv_output = Dropout(0.25)(h)
    
    # classification layers
    h = Flatten()(conv_output)
    h = concatenate([h, Flatten()(aux_input)], axis=1)
Jean-Marc Volle
  • 3,113
  • 1
  • 16
  • 20

1 Answers1

2

Your question is python related not really keras related:

by calling:

i = Flatten()

You instantiate a Flatten object.

By calling: i(conv_output) you call the method __call__ of the Flatten class

Writing it h = Flatten()(conv_output) is just a shortcut because you do not care about the i variable. What you get in h is the return value of the __call__ method of Flatten class

Jean-Marc Volle
  • 3,113
  • 1
  • 16
  • 20