
Classification MLP softmax head (Geron Ch 10, morie.fn grmlc)
Source:R/geron_train_native.R
morie_geron_classification_mlp_output.RdClassification MLP softmax head (Geron Ch 10, morie.fn grmlc)
Examples
morie_geron_classification_mlp_output(matrix(c(1, 2, 0.5, -1),
2, byrow = TRUE), matrix(c(1, -1, 0.5, 2, 0, 1), 3, byrow = TRUE),
c(0.1, 0.2, -0.1))
#> $probabilities
#> [,1] [,2] [,3]
#> [1,] 0.003473778 0.93940118 0.05712504
#> [2,] 0.900854122 0.03860352 0.06054236
#>
#> $logits
#> [,1] [,2] [,3]
#> [1,] -0.9 4.70 1.9
#> [2,] 1.6 -1.55 -1.1
#>
#> $predicted_class
#> [1] 1 0
#>
#> $max_probability
#> [1] 0.9394012 0.9008541
#>
#> $n_classes
#> [1] 3
#>
#> $estimate
#> [,1] [,2] [,3]
#> [1,] 0.003473778 0.93940118 0.05712504
#> [2,] 0.900854122 0.03860352 0.06054236
#>
#> $n
#> [1] 2
#>