pub struct BinaryLogLoss { /* private fields */ }Expand description
Binary cross-entropy (log) loss.
Implementations§
Source§impl BinaryLogLoss
impl BinaryLogLoss
Sourcepub fn with_epsilon(epsilon: f64) -> Result<Self, RillError>
pub fn with_epsilon(epsilon: f64) -> Result<Self, RillError>
Create a new log loss with a custom epsilon.
Sourcepub fn loss(&self, probability: f64, target: bool) -> f64
pub fn loss(&self, probability: f64, target: bool) -> f64
Compute the log loss given a probability and boolean target.
Sourcepub fn gradient_wrt_logit(&self, probability: f64, target: bool) -> f64
pub fn gradient_wrt_logit(&self, probability: f64, target: bool) -> f64
Gradient of the loss w.r.t. the logit z = log(p / (1 - p)).
This equals p - y where p = sigmoid(z).
Trait Implementations§
Source§impl Clone for BinaryLogLoss
impl Clone for BinaryLogLoss
Source§fn clone(&self) -> BinaryLogLoss
fn clone(&self) -> BinaryLogLoss
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BinaryLogLoss
impl Debug for BinaryLogLoss
Auto Trait Implementations§
impl Freeze for BinaryLogLoss
impl RefUnwindSafe for BinaryLogLoss
impl Send for BinaryLogLoss
impl Sync for BinaryLogLoss
impl Unpin for BinaryLogLoss
impl UnsafeUnpin for BinaryLogLoss
impl UnwindSafe for BinaryLogLoss
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more