MCPcopy Create free account
hub / github.com/rushter/MLAlgorithms / pooling_shape

Function pooling_shape

mla/neuralnet/layers/convnet.py:221–231  ·  view source on GitHub ↗

Calculate output shape for pooling layer.

(pool_shape, image_shape, stride)

Source from the content-addressed store, hash-verified

219
220
221def pooling_shape(pool_shape, image_shape, stride):
222 """Calculate output shape for pooling layer."""
223 n_images, n_channels, height, width = image_shape
224
225 height = (height - pool_shape[0]) / float(stride[0]) + 1
226 width = (width - pool_shape[1]) / float(stride[1]) + 1
227
228 assert height % 1 == 0
229 assert width % 1 == 0
230
231 return int(height), int(width)

Callers 1

forward_passMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected