Learn R Programming

multiSA (version 0.1.0)

softmax: Softmax function

Description

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

Usage

softmax(eta, log = FALSE)

Value

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

Arguments

eta

Vector

log

Logical, whether to return the value of the logarithm

Details

Uses multiSA:::logspace.add for numerical stability