#include <shark/ObjectiveFunctions/Loss/SquaredLoss.h>
Public Member Functions | |
SquaredLoss () | |
Constructor. More... | |
std::string | name () const |
From INameable: return the class name. More... | |
double | eval (BatchLabelType const &labels, BatchOutputType const &predictions) const |
Evaluate the squared loss \( (label - prediction)^2 \). More... | |
double | evalDerivative (BatchLabelType const &labels, BatchOutputType const &predictions, BatchOutputType &gradient) const |
Public Member Functions inherited from shark::AbstractLoss< unsigned int, OutputType > | |
AbstractLoss () | |
virtual double | eval (ConstLabelReference target, ConstOutputReference prediction) const |
evaluate the loss for a target and a prediction More... | |
double | eval (Data< LabelType > const &targets, Data< OutputType > const &predictions) const |
virtual double | evalDerivative (ConstLabelReference target, ConstOutputReference prediction, OutputType &gradient) const |
evaluate the loss and its derivative for a target and a prediction More... | |
virtual double | evalDerivative (ConstLabelReference target, ConstOutputReference prediction, OutputType &gradient, MatrixType &hessian) const |
evaluate the loss and its first and second derivative for a target and a prediction More... | |
double | operator() (LabelType const &target, OutputType const &prediction) const |
evaluate the loss for a target and a prediction More... | |
double | operator() (BatchLabelType const &target, BatchOutputType const &prediction) const |
Public Member Functions inherited from shark::AbstractCost< unsigned int, OutputType > | |
virtual | ~AbstractCost () |
const Features & | features () const |
virtual void | updateFeatures () |
bool | hasFirstDerivative () const |
returns true when the first parameter derivative is implemented More... | |
bool | isLossFunction () const |
returns true when the cost function is in fact a loss function More... | |
double | operator() (Data< LabelType > const &targets, Data< OutputType > const &predictions) const |
Public Member Functions inherited from shark::INameable | |
virtual | ~INameable () |
Additional Inherited Members | |
Protected Attributes inherited from shark::AbstractCost< unsigned int, OutputType > | |
Features | m_features |
Definition at line 91 of file SquaredLoss.h.
typedef base_type::BatchLabelType shark::SquaredLoss< OutputType, unsigned int >::BatchLabelType |
Definition at line 96 of file SquaredLoss.h.
typedef base_type::BatchOutputType shark::SquaredLoss< OutputType, unsigned int >::BatchOutputType |
Definition at line 95 of file SquaredLoss.h.
|
inline |
Constructor.
Definition at line 99 of file SquaredLoss.h.
References shark::AbstractCost< LabelType, OutputType >::HAS_FIRST_DERIVATIVE, and shark::AbstractCost< LabelType, OutputType >::m_features.
|
inlinevirtual |
Evaluate the squared loss \( (label - prediction)^2 \).
Implements shark::AbstractLoss< unsigned int, OutputType >.
Definition at line 112 of file SquaredLoss.h.
References SIZE_CHECK.
|
inlinevirtual |
Evaluate the squared loss \( (label - prediction)^2 \) and its deriative \( \frac{\partial}{\partial prediction} 1/2 (label - prediction)^2 = prediction - label \).
Reimplemented from shark::AbstractLoss< unsigned int, OutputType >.
Definition at line 126 of file SquaredLoss.h.
|
inlinevirtual |
From INameable: return the class name.
Reimplemented from shark::INameable.
Definition at line 106 of file SquaredLoss.h.
References shark::AbstractLoss< LabelType, OutputType >::eval().