Questions about maxpooling2D layer

In w3a2 exercise1, when max_pooling=True, I have to implement maxpooling2d layer.
next_layer = MaxPooling2D(pool_size=None1)(None2)
I think “None1” is already given, but what is “None2”?
I previously thought “None2” is Conv, but there is attribution error ( points to this line) saying “‘Dropout’ object has no attribute ‘shape’”, and I don’t know why!

You’re using the Functional API there, correct? The abstract syntax looks like this…

NOTE: code fragment edited to incorporate @paulinpaloalto 's response below which provided a more accurate nomenclature.

this_layer_output = LayerClassName(constructor_parameters)(previous_layer_output)

From which None1 is a constructor parameter value, and None2 would be the output of the previous layer in the model. Let us know if this helps?

ps: You might also want to take a look at the Functional API section of this related thread: Tips for troubles with Sequential and Functional API syntax

1 Like

Wouldn’t it be slightly more natural to write it this way:

this_layer_output = LayerClassName(constructor_parameters)(previous_layer_output)

To me the term “instance” would seem more natural when applied like this:

this_layer_instance = LayerClassName(constructor_parameters)
this_layer_output = this_layer_instance(previous_layer_output)

Or I guess you could go for max verbosity like this:
this_layer_instance_output = LayerClassName(constructor_parameters)(previous_layer_instance_output)

But that seems like overkill. And also the formatting stubs its toe on that, because of line overflow.

If I’m just missing the point, please elaborate.

1 Like

Yours is better. Leaving my answer there since it has the link but will update to reflect your input. My brain is foggy today :frowning:

Definitely leave yours there. The epic link is the real answer to everything here! :nerd_face:

Thanks, I think my problem has been settled!

Thanks for you generous help:)