1 #ifndef STAN__MATH__MATRIX__LOG_SOFTMAX_HPP
2 #define STAN__MATH__MATRIX__LOG_SOFTMAX_HPP
43 inline Eigen::Matrix<T,Eigen::Dynamic,1>
49 Eigen::Matrix<T,Eigen::Dynamic,1> theta(v.size());
51 for (
int i = 0; i < v.size(); ++i)
boost::math::tools::promote_args< T1, T2 >::type log_sum_exp(const T2 &a, const T1 &b)
Calculates the log sum of exponetials without overflow.
Eigen::Matrix< T, Eigen::Dynamic, 1 > log_softmax(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &v)
Return the natural logarithm of the softmax of the specified vector.
fvar< T > log(const fvar< T > &x)
fvar< T > exp(const fvar< T > &x)
bool check_nonzero_size(const char *function, const T_y &y, const char *name, T_result *result)
Return true if the specified matrix/vector is of non-zero size.