Add usage example for MaxPool2D

Add usage example for MaxPool2D
This commit is contained in:
Joseph-Rance 2020-01-14 16:37:01 +00:00 committed by GitHub
parent d8da788574
commit 33ea90beac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -370,6 +370,12 @@ class MaxPooling2D(Pooling2D):
[[10.],
[11.],
[12.]]]], dtype=float32)>
Usage Example:
>>> model = tf.keras.models.Sequential()
>>> model.add(tf.keras.layers.Conv2D(32, kernel_size=(3, 3), input_shape=(28,28,1)))
>>> model.add(tf.keras.layers.MaxPooling2D(pool_size=(2, 2)))
For example, for stride=(1,1) and padding="same":