Previous question · 304
Min Cost Climbing Stairs
easyAlgorithms
Next question · 306
Diameter of Binary Tree
easyData Structures
Random coding question

305. Pooling operations

medium
GeneralGeneral
staff
Function contract
Inputs
mode
str
image
np.ndarray
stride
list
kernel_size
list
Returns
value
np.ndarray

Examples

Input
{
  "mode": "max",
  "image": [
    [
      1,
      3,
      2,
      0
    ],
    [
      4,
      6,
      5,
      1
    ],
    [
      7,
      2,
      8,
      3
    ],
    [
      0,
      1,
      2,
      9
    ]
  ],
  "stride": [
    2,
    2
  ],
  "kernel_size": [
    2,
    2
  ]
}
Output
[
  [
    6,
    5
  ],
  [
    7,
    9
  ]
]

Constraints

Hint 1
Hint 2
Hint 3
Roles
ML Engineer
AI Engineer
Data Scientist
Research Scientist
Companies
GeneralGeneral
Levels
staff
senior
entry
Tags
numpy-slicing
2d-pooling
sliding-window
computer-vision

Similar Questions

Linear Regressionmedium
ML Coding
Activation function relueasy
ML Coding
Text normalizationmedium
ML Coding
21 people are solving this problem
Loading editor for the selected language
Ln 1, Col 1
Program Output
DATAINTERVIEW
Interactive coding terminal
Python / NumPy environment ready.
Type a command below or run code from the editor.
run scriptExecute the current editor contents
submitGrade the current editor contents against all solution test cases
python ("print hello world")Run an isolated Python command
helpShow all available commands