Skip to contents

s = sigmoid(W2 ReLU(W1 GAP(x))); y = s * x. Squeeze is global average pooling over the spatial axes (input dims 1,2), excitation is a bottleneck MLP C -> C/r -> C.

Usage

morie_geron_senet(x, r = 16, W1 = NULL, W2 = NULL, seed = 0)

Arguments

x

Feature map array with dim (H, W, C), or a plain vector (C,).

r

Reduction ratio; must divide C.

W1, W2

Optional excitation weights (C, C/r) and (C/r, C); default LCG.

seed

LCG seed when W1/W2 not supplied.

Value

list with y, s, gate, z, hidden, n_params, estimate, n, method.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_senet(V)
#> $y
#> [1] 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0
#> 
#> $s
#> [1] 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5
#> 
#> $gate
#> [1] 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5
#> 
#> $z
#> [1] 1 2 3 4 5 6 7 8
#> 
#> $hidden
#> [1] 0
#> 
#> $n_params
#> [1] 0
#> 
#> $estimate
#> [1] 0.5
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Squeeze (GAP) -> excite (bottleneck MLP + sigmoid) -> scale"
#>