0

I found the below answer on implementing max-pooling with 'numpy' and 'block_reduce' of skimage. But it doesn't show how to get the index of the max value (preferably with respect to the actual matrix, not the pooled one). What is the most computationally fast solution to this?

import numpy as np
import skimage.measure

a = np.array([
      [  20,  200,   -5,   23],
      [ -13,  134,  119,  100],
      [ 120,   32,   49,   25],
      [-120,   12,    9,   23]
])
skimage.measure.block_reduce(a, (2,2), np.max)
Manu Soman
  • 153
  • 11

0 Answers0