All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
binary_log_loss.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_FWD_SCAL_FUN_BINARY_LOG_LOSS_HPP
#define STAN_MATH_FWD_SCAL_FUN_BINARY_LOG_LOSS_HPP
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/binary_log_loss.hpp>
namespace stan {
namespace math {
template <typename T>
inline
fvar<T>
binary_log_loss(const int y, const fvar<T>& y_hat) {
using stan::math::binary_log_loss;
if (y)
return fvar<T>(binary_log_loss(y, y_hat.val_),
-y_hat.d_ / y_hat.val_);
else
return fvar<T>(binary_log_loss(y, y_hat.val_),
y_hat.d_ / (1.0 - y_hat.val_));
}
}
}
#endif
core.hpp
stan::math::fvar::d_
T d_
Definition: fvar.hpp:15
stan::math::binary_log_loss
fvar< T > binary_log_loss(const int y, const fvar< T > &y_hat)
Definition: binary_log_loss.hpp:15
binary_log_loss.hpp
stan::math::fvar::val_
T val_
Definition: fvar.hpp:14
stan::math::fvar
Definition: fvar.hpp:13

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