Skip to contents

Masks via the shared LCG stream, not numpy PCG64.

Usage

morie_geron_mc_dropout(model, x, K = 100, p = 0.5, seed = 0)

Arguments

model

function(x_masked) -> prediction.

x

Input.

K

Passes.

p

Drop probability.

seed

Seed.

Value

List with mean, var, std, sem, samples, predictive_entropy, estimate, n, method.

Examples

f <- function(z) sum(z)
morie_geron_mc_dropout(f, c(1, 2, 3), K = 10, p = 0)
#> $mean
#> [1] 6
#> 
#> $var
#> [1] 0
#> 
#> $std
#> [1] 0
#> 
#> $sem
#> [1] 0
#> 
#> $samples
#>     [,1]
#> out    6
#> out    6
#> out    6
#> out    6
#> out    6
#> out    6
#> out    6
#> out    6
#> out    6
#> out    6
#> 
#> $predictive_entropy
#> NULL
#> 
#> $K
#> [1] 10
#> 
#> $p
#> [1] 0
#> 
#> $estimate
#> [1] 6
#> 
#> $n
#> [1] 3
#> 
#> $method
#> [1] "Monte Carlo dropout uncertainty"
#>