af.softmax | R Documentation |
This function computes the softmax of a numeric vector. The softmax function transforms a vector of real values into a probability distribution, where each element is between 0 and 1 and the sum of all elements is 1. @seealso DNN_predictor
af.softmax(x)
x |
A numeric vector for which the softmax transformation is to be computed. |
The softmax function is calculated as:
softmax(x_i) = \frac{exp(x_i)}{\sum_{j} exp(x_j)}
In the case of overflow (i.e., when exp(x_i)
is too large), this function handles
Inf
values by assigning 1
to the corresponding positions and 0
to the
others before Softmax. @seealso DNN_predictor
A numeric vector representing the softmax-transformed values of x
.
x <- c(1, 2, 3)
af.softmax(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.