-
-
Save agnesmm/4927ecbe8f2726643f2bfba8d202f805 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import skimage.measure | |
x = np.random.randint(5, size=(10, 10)) | |
def max_pooling(x, n_patch=2): | |
return skimage.measure.block_reduce(x, (n_patch,n_patch), np.max) | |
print(x) | |
print(max_pooling(x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment