pub struct SmoothL1Loss {
pub beta: f32,
pub reduction: LossReduction,
}
Expand description
Computes the smooth L1 loss.
The smooth L1 loss is a variant of the L1 loss which replaces the absolute
difference with a squared difference when the absolute difference is less
than beta
.
Fields§
§beta: f32
The threshold after which the loss changes from the squared to the absolute difference.
Default to SmoothL1Loss::DEFAULT_BETA
reduction: LossReduction
Reduction type. Default to SmoothL1Loss::DEFAULT_REDUCTION
Implementations§
Source§impl SmoothL1Loss
impl SmoothL1Loss
Source§impl SmoothL1Loss
impl SmoothL1Loss
Sourcepub const DEFAULT_BETA: f32 = 1f32
pub const DEFAULT_BETA: f32 = 1f32
Default value for the beta
parameter.
Sourcepub const DEFAULT_REDUCTION: LossReduction = LossReduction::Mean
pub const DEFAULT_REDUCTION: LossReduction = LossReduction::Mean
Default value for the reduction
parameter.
Trait Implementations§
Source§impl Buildable for SmoothL1Loss
impl Buildable for SmoothL1Loss
Source§type Builder = SmoothL1LossBuilder
type Builder = SmoothL1LossBuilder
The builder type for this buildable type
Source§impl Builder<SmoothL1Loss> for SmoothL1LossBuilder
impl Builder<SmoothL1Loss> for SmoothL1LossBuilder
Source§type Error = Infallible
type Error = Infallible
Error with building
Source§impl Clone for SmoothL1Loss
impl Clone for SmoothL1Loss
Source§fn clone(&self) -> SmoothL1Loss
fn clone(&self) -> SmoothL1Loss
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 SmoothL1Loss
impl RefUnwindSafe for SmoothL1Loss
impl Send for SmoothL1Loss
impl Sync for SmoothL1Loss
impl Unpin for SmoothL1Loss
impl UnwindSafe for SmoothL1Loss
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
.