Skip to contents

y = F(x) + x; a shape-changing block needs projection.

Usage

morie_geron_resnet_skip(x, Fx, projection = NULL)

Arguments

x

Block input.

Fx

Block output.

projection

Optional (d_in, d_out) shortcut projection.

Value

List with output, shortcut, residual_norm, shortcut_norm, residual_fraction.

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
#>