| Stan Math Library 2.12.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

binary_log_loss.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_FUN_BINARY_LOG_LOSS_HPP
2 #define STAN_MATH_PRIM_SCAL_FUN_BINARY_LOG_LOSS_HPP
3
4 #include <boost/math/tools/promotion.hpp>
5
6 namespace stan {
7 namespace math {
8
24 template <typename T>
25 inline typename boost::math::tools::promote_args<T>::type
26 binary_log_loss(const int y, const T y_hat) {
27 using std::log;
28 return -log(y ? y_hat : (1.0 - y_hat));
29 }
30
31 }
32 }
33
34 #endif
stan
Definition: log_sum_exp.hpp:8
stan::math::binary_log_loss
fvar< T > binary_log_loss(const int y, const fvar< T > &y_hat)
Definition: binary_log_loss.hpp:13
stan::math::log
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:14

[ Stan Home Page ] © 2011–2016, Stan Development Team.