Skip to contents

Max pooling over a sliding window, per channel (Geron Ch 12, morie.fn hmmxp)

Usage

morie_geron_max_pool(x, window = 2, stride = NULL)

Arguments

x

Feature map (h,w) or (h,w,c).

window

Square pooling window.

stride

Defaults to window.

Value

List with pooled, argmax, output_shape, parameters, estimate, n, method.

Examples

M <- matrix(c(1, 2, 3, 4, 5, 6), nrow = 2)
morie_geron_max_pool(M)
#> $pooled
#>      [,1]
#> [1,]    4
#> 
#> $y
#>      [,1]
#> [1,]    4
#> 
#> $argmax
#>      [,1]
#> [1,]    4
#> 
#> $output_shape
#> [1] 1 1
#> 
#> $parameters
#> [1] 0
#> 
#> $estimate
#>      [,1]
#> [1,]    4
#> 
#> $n
#> [1] 6
#> 
#> $method
#> [1] "Max pooling over a sliding window, per channel"
#>