d2l-ai / d2l-en

Interactive deep learning book with multi-framework code, math, and discussions. Adopted at 500 universities from 70 countries including Stanford, MIT, Harvard, and Cambridge.
https://D2L.ai
Other
23.24k stars 4.27k forks source link

adaptation inconsistency: wrong output in maxpool #1271

Closed astonzhang closed 3 years ago

astonzhang commented 4 years ago

http://preview.d2l.ai.s3-website-us-west-2.amazonaws.com/d2l-en/master/chapter_convolutional-neural-networks/pooling.html

mxnet

pool2d = nn.MaxPool2D((2, 3), padding=(1, 2), strides=(2, 3)) pool2d(X) Copy to clipboard array([[[[ 0., 3.], [ 8., 11.], [12., 15.]]]])

tf

pool2d = tf.keras.layers.MaxPool2D(pool_size=[2, 3], padding='same', strides=(2, 3)) pool2d(X) Copy to clipboard <tf.Tensor: shape=(1, 2, 2, 1), dtype=float32, numpy= array([[[[ 5.], [ 7.]],

    [[13.],
     [15.]]]], dtype=float32)>
astonzhang commented 3 years ago

@levimcclenny Thanks for fixing this issue! cc @terrytangyuan