Skip to contents

Mask ~ 1{u < 1-p} over the LCG uniform stream, output a * mask / (1-p).

Usage

morie_geron_dropout(a, p, seed = 0)

Arguments

a

Numeric vector or matrix of activations.

p

Drop probability in [0, 1).

seed

LCG seed.

Value

List with output, mask, keep_prob, fraction_dropped, scale, expectation_ratio.

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