1#ifndef STAN_MATH_PRIM_FUN_BINARY_LOG_LOSS_HPP
2#define STAN_MATH_PRIM_FUN_BINARY_LOG_LOSS_HPP
29template <
typename T, require_arithmetic_t<T>* =
nullptr>
32 return y ? -
log(y_hat) : -
log1m(y_hat);
45template <
typename T1,
typename T2, require_any_container_t<T1, T2>* =
nullptr,
46 require_not_var_matrix_t<T2>* =
nullptr>
49 [](
auto&& c,
auto&& d) {
51 std::forward<
decltype(d)>(d));
53 std::forward<T1>(a), std::forward<T2>(b));
auto apply_scalar_binary(F &&f, T1 &&x, T2 &&y)
Base template function for vectorization of binary scalar functions defined by applying a functor to ...
fvar< T > log(const fvar< T > &x)
fvar< T > binary_log_loss(int y, const fvar< T > &y_hat)
fvar< T > log1m(const fvar< T > &x)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...