50 static constexpr T
kL2 = T(2);
51 static constexpr T
kL1 = T(1);
58 static constexpr T
kWelsch = std::numeric_limits<T>::lowest();
74 [[nodiscard]] T
value(
const T& sqrError)
const;
78 [[nodiscard]] T
deriv(
const T& sqrError)
const;
82 [[nodiscard]]
bool isL2()
const {
101 static constexpr T
kEps = 1e-9;
bool isL2() const
Returns true if this loss is an L2 loss (alpha ~= 2).
static constexpr float kL1
static constexpr float kCauchy
T value(const T &sqrError) const
Returns the loss value for a given squared error.
T invC2() const
Returns the stored 1/c^2 value. For default c=1, this is 1.0.
T deriv(const T &sqrError) const
Derivative of the loss with respect to the input squared error.
static constexpr float kWelsch
static constexpr float kEps
GeneralizedLossT(const T &a=kL2, const T &c=T(1))
Constructs a generalized loss with shape a and scale c.
static constexpr float kL2