pub struct LogCoshLoss {
pub reduction: LossReduction,
}
Expand description
Computes the log cosh loss between inputs and targets.
Logcosh acts like L2 loss for small errors, ensuring stable gradients, and like the L1 loss for large errors, reducing sensitivity to outliers. This dual behavior offers a balanced, robust approach for regression tasks.
Fields§
§reduction: LossReduction
Reduction type. Default to LogCoshLoss::DEFAULT_REDUCTION
Implementations§
Source§impl LogCoshLoss
impl LogCoshLoss
Source§impl LogCoshLoss
impl LogCoshLoss
Sourcepub const DEFAULT_REDUCTION: LossReduction = LossReduction::None
pub const DEFAULT_REDUCTION: LossReduction = LossReduction::None
Default value for the reduction
parameter.
Trait Implementations§
Source§impl Buildable for LogCoshLoss
impl Buildable for LogCoshLoss
Source§type Builder = LogCoshLossBuilder
type Builder = LogCoshLossBuilder
The builder type for this buildable type
Source§impl Builder<LogCoshLoss> for LogCoshLossBuilder
impl Builder<LogCoshLoss> for LogCoshLossBuilder
Source§type Error = Infallible
type Error = Infallible
Error with building
Source§impl Clone for LogCoshLoss
impl Clone for LogCoshLoss
Source§fn clone(&self) -> LogCoshLoss
fn clone(&self) -> LogCoshLoss
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for LogCoshLoss
impl RefUnwindSafe for LogCoshLoss
impl Send for LogCoshLoss
impl Sync for LogCoshLoss
impl Unpin for LogCoshLoss
impl UnwindSafe for LogCoshLoss
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Convert into an
Option
.