Skip to contents

Inverted dropout: y = mask * x / (1 - p) (hmdrp)

Usage

morie_geron_dropout_alt(x, p, training = TRUE, seed = 0)

Arguments

x

Activations.

p

Drop probability in [0, 1).

training

If FALSE, pass through unchanged.

seed

LCG seed.

Value

List with y, mask, scale, n_dropped, drop_fraction.

Examples

morie_geron_dropout_alt(x = c(1, 2, 3, 4, 5, 6, 7, 8), p = 0.5)
#> $y
#> [1]  0  0  6  8  0 12  0 16
#> 
#> $mask
#> [1] 0 0 1 1 0 1 0 1
#> 
#> $scale
#> [1] 2
#> 
#> $n_dropped
#> [1] 4
#> 
#> $drop_fraction
#> [1] 0.5
#> 
#> $p
#> [1] 0.5
#> 
#> $training
#> [1] TRUE
#> 
#> $expectation_ok
#> [1] TRUE
#> 
#> $estimate
#> [1] 5.25
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "inverted dropout y = mask * x / (1 - p)"
#>