softmax: Softmax function

View source: R/misc.R

softmaxR Documentation

Softmax function

Description

Takes a vector of real numbers and returns the corresponding vector of probabilities

Usage

softmax(eta, log = FALSE)

Arguments

eta

Vector

log

Logical, whether to return the value of the logarithm

Details

Uses multiSA:::logspace.add for numerical stability

Value

Numeric, vector length of eta: \exp(\eta)/\sum\exp(\eta)


multiSA documentation built on March 21, 2026, 1:06 a.m.