Stan Math Library
4.9.0
Automatic Differentiation
|
void stan::math::inverse_softmax | ( | const Vector & | simplex, |
Vector & | y | ||
) |
Writes the inverse softmax of the simplex argument into the second argument.
See softmax
for the inverse function and a definition of the relation.
The inverse softmax function is defined by
\(\mbox{inverse\_softmax}(x)[i] = \log x[i]\).
This function defines the inverse of softmax
up to a scaling factor.
Because of the definition, values of 0.0 in the simplex are converted to negative infinity, and values of 1.0 are converted to 0.0.
There is no check that the input vector is a valid simplex vector.
Vector | type of the simplex vector |
simplex | Simplex vector input. |
y | Vector into which the inverse softmax is written. |
std::invalid_argument | if size of the input and output vectors differ. |
Definition at line 37 of file inverse_softmax.hpp.