Skip to contents

y = F(x) + x, optionally with a projected skip. dy/dx = I + dF/dx is what keeps a gradient path open through arbitrary depth.

Usage

morie_geron_resnet(x, F, projection = NULL)

Arguments

x

Input array.

F

Function of x.

projection

Optional function applied to the skip path.

Value

List with y, output, residual, skip, residual_fraction, estimate, n.

Examples

a <- 0.5
morie_geron_resnet(c(1, 2, 3), function(a) a * 0.5)
#> $y
#> [1] 1.5 3.0 4.5
#> 
#> $output
#> [1] 1.5 3.0 4.5
#> 
#> $residual
#> [1] 0.5 1.0 1.5
#> 
#> $skip
#> [1] 1 2 3
#> 
#> $residual_fraction
#> [1] 0.3333333
#> 
#> $estimate
#> [1] 1.5 3.0 4.5
#> 
#> $n
#> [1] 3
#> 
#> $method
#> [1] "Residual block y = F(x) + x (optionally projected skip)"
#>