softmax: Apply the softmax function to a vector of values.

View source: R/bound_transforms.R

softmaxR Documentation

Apply the softmax function to a vector of values.

Description

Apply the softmax function to a vector of values.

Usage

softmax(x)

Arguments

x

Vector of values.

Details

Apply the softmax function to a vector of values, e.g.:

\text{softmax}(z_i) = \frac{e^{z_i}}{\sum_{j = 1}^K \ e^{z_j}}

Examples

softmax(seq(from = 0, to = 1, by = 0.25))

markjrieke/riekelib documentation built on Dec. 20, 2024, 4:57 a.m.