34 #ifndef SHARK_OBJECTIVEFUNCTIONS_LOSS_ABSTRACTLOSS_H 35 #define SHARK_OBJECTIVEFUNCTIONS_LOSS_ABSTRACTLOSS_H 57 template<
class LabelT,
class OutputT = LabelT>
77 virtual double eval( BatchLabelType
const& target, BatchOutputType
const& prediction)
const = 0;
83 virtual double eval( LabelType
const& target, OutputType
const& prediction)
const{
85 get(labelBatch,0)=target;
87 get(predictionBatch,0)=prediction;
88 return eval(labelBatch,predictionBatch);
96 virtual double evalDerivative(LabelType
const& target, OutputType
const& prediction, OutputType& gradient)
const {
98 get(labelBatch, 0) = target;
100 get(predictionBatch, 0) = prediction;
102 double ret =
evalDerivative(labelBatch, predictionBatch, gradientBatch);
103 gradient =
get(gradientBatch, 0);
114 LabelType
const& target, OutputType
const& prediction,
115 OutputType& gradient,MatrixType & hessian
130 virtual double evalDerivative(BatchLabelType
const& target, BatchOutputType
const& prediction, BatchOutputType& gradient)
const 181 double operator () (LabelType
const& target, OutputType
const& prediction)
const 182 {
return eval(target, prediction); }
184 double operator () (BatchLabelType
const& target, BatchOutputType
const& prediction)
const 185 {
return eval(target, prediction); }
187 using base_type::operator();