
Residual (skip) connection (Geron Ch 14, morie.fn grrsk)
Source:R/geron_train_native.R
morie_geron_resnet_skip.Rdy = F(x) + x; a shape-changing block needs projection.
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_resnet_skip(V, V)
#> $output
#> [1] 2 4 6 8 10 12 14 16
#>
#> $shortcut
#> [1] 1 2 3 4 5 6 7 8
#>
#> $residual_norm
#> [1] 14.28286
#>
#> $shortcut_norm
#> [1] 14.28286
#>
#> $residual_fraction
#> [1] 0.5
#>
#> $estimate
#> [1] 2 4 6 8 10 12 14 16
#>
#> $n
#> [1] 8
#>