pub struct GaussianNllLoss {
pub full: bool,
pub eps: f32,
pub reduction: LossReduction,
}
Expand description
Compute the negative log likelihood loss for a Gaussian distribution.
Fields§
§full: bool
Whether to include the constant term in the loss calculation. Default to
GaussianNllLoss::DEFAULT_FULL
eps: f32
Small positive constant for numerical stability. Default to
GaussianNllLoss::DEFAULT_EPS
reduction: LossReduction
Reduction type. Default to GaussianNllLoss::DEFAULT_REDUCTION
Implementations§
Source§impl GaussianNllLoss
impl GaussianNllLoss
Sourcepub const DEFAULT_FULL: bool = false
pub const DEFAULT_FULL: bool = false
Default value for the full
parameter.
Sourcepub const DEFAULT_EPS: f32 = 9.99999997E-7f32
pub const DEFAULT_EPS: f32 = 9.99999997E-7f32
Default value for the eps
parameter.
Sourcepub const DEFAULT_REDUCTION: LossReduction = LossReduction::None
pub const DEFAULT_REDUCTION: LossReduction = LossReduction::None
Default value for the reduction
parameter.
Sourcepub fn apply(
&self,
inputs: impl AsRef<Array>,
targets: impl AsRef<Array>,
vars: impl AsRef<Array>,
) -> Result<Array, Exception>
pub fn apply( &self, inputs: impl AsRef<Array>, targets: impl AsRef<Array>, vars: impl AsRef<Array>, ) -> Result<Array, Exception>
Compute the negative log likelihood loss for a Gaussian distribution.
§Params
inputs
: The predicted expectation of the Gaussian distribution.targets
: The target values (samples from the Gaussian distribution).vars
: The predicted variance of the Gaussian distribution.
Trait Implementations§
Source§impl Buildable for GaussianNllLoss
impl Buildable for GaussianNllLoss
Source§type Builder = GaussianNllLossBuilder
type Builder = GaussianNllLossBuilder
The builder type for this buildable type
Source§impl Builder<GaussianNllLoss> for GaussianNllLossBuilder
impl Builder<GaussianNllLoss> for GaussianNllLossBuilder
Source§type Error = Infallible
type Error = Infallible
Error with building
Source§impl Clone for GaussianNllLoss
impl Clone for GaussianNllLoss
Source§fn clone(&self) -> GaussianNllLoss
fn clone(&self) -> GaussianNllLoss
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 GaussianNllLoss
impl RefUnwindSafe for GaussianNllLoss
impl Send for GaussianNllLoss
impl Sync for GaussianNllLoss
impl Unpin for GaussianNllLoss
impl UnwindSafe for GaussianNllLoss
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
.