|
std::string | getType () |
|
float | getLoss (shared_data *, float prediction, float label) |
|
float | getUpdate (float prediction, float label, float update_scale, float pred_per_update) |
|
float | getUnsafeUpdate (float prediction, float label, float update_scale) |
|
float | getRevertingWeight (shared_data *, float prediction, float eta_t) |
|
float | getSquareGrad (float prediction, float label) |
|
float | first_derivative (shared_data *, float prediction, float label) |
|
float | second_derivative (shared_data *, float, float) |
|
virtual | ~loss_function () |
|
Definition at line 116 of file loss_functions.cc.
◆ first_derivative()
float hingeloss::first_derivative |
( |
shared_data * |
, |
|
|
float |
prediction, |
|
|
float |
label |
|
) |
| |
|
inlinevirtual |
◆ getLoss()
float hingeloss::getLoss |
( |
shared_data * |
, |
|
|
float |
prediction, |
|
|
float |
label |
|
) |
| |
|
inlinevirtual |
Implements loss_function.
Definition at line 121 of file loss_functions.cc.
References f.
123 if (label != -1.
f && label != 1.
f)
124 std::cout <<
"You are using label " << label <<
" not -1 or 1 as loss function expects!" << std::endl;
125 float e = 1 - label * prediction;
126 return (e > 0) ? e : 0;
◆ getRevertingWeight()
float hingeloss::getRevertingWeight |
( |
shared_data * |
, |
|
|
float |
prediction, |
|
|
float |
eta_t |
|
) |
| |
|
inlinevirtual |
◆ getSquareGrad()
float hingeloss::getSquareGrad |
( |
float |
prediction, |
|
|
float |
label |
|
) |
| |
|
inlinevirtual |
◆ getType()
std::string hingeloss::getType |
( |
| ) |
|
|
inlinevirtual |
◆ getUnsafeUpdate()
float hingeloss::getUnsafeUpdate |
( |
float |
prediction, |
|
|
float |
label, |
|
|
float |
update_scale |
|
) |
| |
|
inlinevirtual |
◆ getUpdate()
float hingeloss::getUpdate |
( |
float |
prediction, |
|
|
float |
label, |
|
|
float |
update_scale, |
|
|
float |
pred_per_update |
|
) |
| |
|
inlinevirtual |
Implements loss_function.
Definition at line 129 of file loss_functions.cc.
131 if (label * prediction >= 1)
133 float err = 1 - label * prediction;
134 return label * (update_scale * pred_per_update < err ? update_scale : err / pred_per_update);
◆ second_derivative()
float hingeloss::second_derivative |
( |
shared_data * |
, |
|
|
float |
, |
|
|
float |
|
|
) |
| |
|
inlinevirtual |
The documentation for this class was generated from the following file: