
Inverted dropout (Geron Ch 11, morie.fn grdro)
Source:R/geron_train_native.R
morie_geron_dropout.RdMask ~ 1{u < 1-p} over the LCG uniform stream, output a * mask / (1-p).
Examples
morie_geron_dropout(a = c(1, 2, 3, 4, 5, 6, 7, 8), p = 0.5)
#> $output
#> [1] 2 4 0 0 10 0 14 0
#>
#> $mask
#> [1] 1 1 0 0 1 0 1 0
#>
#> $keep_prob
#> [1] 0.5
#>
#> $fraction_dropped
#> [1] 0.5
#>
#> $scale
#> [1] 2
#>
#> $expectation_ratio
#> [1] 0.8333333
#>
#> $p
#> [1] 0.5
#>
#> $seed
#> [1] 0
#>
#> $estimate
#> [1] 2 4 0 0 10 0 14 0
#>
#> $n
#> [1] 8
#>