Skip to contents

The listing on p. 410 is softmax(logits) over a batch repeated T times, then .mean(dim = 1) across the T passes. logits here is that same structure – an n by T by k array – supplied by the caller, so the dropout masks live outside this function and both language arms see identical numbers.

Usage

morie_mcdrop(logits)

Arguments

logits

n by T by k array of class logits

Value

list(probs, sds, pred, meanmaxprob, meanmaxsd, meanentropy, n, t, k)

Examples

set.seed(1)
logits <- array(rnorm(2 * 5 * 3), dim = c(2, 5, 3))
r <- morie_mcdrop(logits)
c(length(r$pred), r$k)
#> [1] 2 3