Thanks Jan. If I change it to a 2D layer then you're right, the shape
is correct. I did that because I want to use 1D maxpooling on
spectrograms (I'll do it via pool_size=(1,mypoolsize) in future).
I filed an issue for the check you suggested:
https://github.com/Lasagne/Lasagne/issues/568
One thing I notice is that overlapping patches can give unexpected
results. I think this is just a "lucky" example, but notice how the
output creates a value of 18, which must be due to overlapping patches
both having the same winner, and thus both separately adding a 9 back
on to the reconstruction:
input:
[[[[ 0. 1. 0. 0. 0.]
[ 0. 0. 0. 0. 0.]
[ 0. 0. 9. 0. 0.]
[ 0. 0. 0. 9. 0.]]
[[ 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0.]
[ 7. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0.]]
[[ 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 1.]
[ 0. 0. 0. 0. 0.]]]
[[[ 0. 0. 0. 0. 1.]
[ 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0.]
[ 3. 0. 0. 0. 0.]]
[[ 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 1.]]
[[ 0. 9. 0. 0. 0.]
[ 0. 0. 5. 0. 0.]
[ 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0.]]]]
latents (shape (2, 3, 1, 2))
output:
[[[[ 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0.]
[ 0. 0. 18. 0. 0.]
[ 0. 0. 0. 0. 0.]]
[[ 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0.]
[ 7. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0.]]
[[ 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 1.]
[ 0. 0. 0. 0. 0.]]]
[[[ 0. 0. 0. 0. 1.]
[ 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0.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