
Squeeze-and-Excitation (SENet) block for channel recalibration
Source:R/geron_w4d_native.R
morie_geron_senet.Rds = 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.
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"
#>