Skip to content

Instantly share code, notes, and snippets.

@agnesmm agnesmm/a3g4.py Secret
Created Sep 19, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.