
Softmax function (morie.fn grn021)
Source:R/geron_train_native.R
morie_geron_ch4_softmax_function.RdMax-shifted normalized exponential; k and argmax are 0-based.
Examples
morie_geron_ch4_softmax_function(s = c(1, 2, 3, 4, 5, 6, 7, 8), k = 5L)
#> $probability
#> [1] 0.08557692
#>
#> $probabilities
#> [1] 0.0005766128 0.0015673960 0.0042606241 0.0115815771 0.0314819905
#> [6] 0.0855769227 0.2326221940 0.6323326828
#>
#> $argmax
#> [1] 7
#>
#> $estimate
#> [1] 0.08557692
#>
#> $n
#> [1] 8
#>