Skip to main content

softmax

softmax(z, i, k) ⇒ number

Normalized exponential function, converts vector of size K into probability distribution of K possible outcomes Useful in neural network implementations

Kind: global function
See: https://en.wikipedia.org/wiki/Softmax_function

ParamTypeDescription
zArray.<number> | Float32Arrayinput vector
inumberElement in vector Z to compute softmax for
knumberShould be >= 1, typically dimension of Z