|
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, float) |
|
float | getSquareGrad (float prediction, float label) |
|
float | first_derivative (shared_data *, float prediction, float label) |
|
float | second_derivative (shared_data *, float prediction, float) |
|
virtual | ~loss_function () |
|
Definition at line 305 of file loss_functions.cc.
◆ first_derivative()
float poisson_loss::first_derivative |
( |
shared_data * |
, |
|
|
float |
prediction, |
|
|
float |
label |
|
) |
| |
|
inlinevirtual |
◆ getLoss()
float poisson_loss::getLoss |
( |
shared_data * |
, |
|
|
float |
prediction, |
|
|
float |
label |
|
) |
| |
|
inlinevirtual |
Implements loss_function.
Definition at line 310 of file loss_functions.cc.
References f.
313 std::cout <<
"You are using label " << label <<
" but loss function expects label >= 0!" << std::endl;
314 float exp_prediction = expf(prediction);
316 return 2 * (label * (logf(label + 1e-6
f) - prediction) - (label - exp_prediction));
◆ getRevertingWeight()
float poisson_loss::getRevertingWeight |
( |
shared_data * |
, |
|
|
float |
, |
|
|
float |
|
|
) |
| |
|
inlinevirtual |
◆ getSquareGrad()
float poisson_loss::getSquareGrad |
( |
float |
prediction, |
|
|
float |
label |
|
) |
| |
|
inlinevirtual |
Implements loss_function.
Definition at line 344 of file loss_functions.cc.
346 float exp_prediction = expf(prediction);
347 return (exp_prediction - label) * (exp_prediction - label);
◆ getType()
std::string poisson_loss::getType |
( |
| ) |
|
|
inlinevirtual |
◆ getUnsafeUpdate()
float poisson_loss::getUnsafeUpdate |
( |
float |
prediction, |
|
|
float |
label, |
|
|
float |
update_scale |
|
) |
| |
|
inlinevirtual |
Implements loss_function.
Definition at line 333 of file loss_functions.cc.
335 float exp_prediction = expf(prediction);
336 return (label - exp_prediction) * update_scale;
◆ getUpdate()
float poisson_loss::getUpdate |
( |
float |
prediction, |
|
|
float |
label, |
|
|
float |
update_scale, |
|
|
float |
pred_per_update |
|
) |
| |
|
inlinevirtual |
Implements loss_function.
Definition at line 319 of file loss_functions.cc.
321 float exp_prediction = expf(prediction);
324 return label * update_scale -
325 log1p(exp_prediction * expm1(label * update_scale * pred_per_update) / label) / pred_per_update;
329 return -log1p(exp_prediction * update_scale * pred_per_update) / pred_per_update;
◆ second_derivative()
float poisson_loss::second_derivative |
( |
shared_data * |
, |
|
|
float |
prediction, |
|
|
float |
|
|
) |
| |
|
inlinevirtual |
The documentation for this class was generated from the following file: