pub struct CompositeObjective<'a> { /* private fields */ }Expand description
A composite objective that combines a loss function with optional regularization
Implementations§
Source§impl<'a> CompositeObjective<'a>
impl<'a> CompositeObjective<'a>
Sourcepub fn new(
loss: &'a dyn LossFunction,
regularization: Option<&'a dyn Regularization>,
) -> Self
pub fn new( loss: &'a dyn LossFunction, regularization: Option<&'a dyn Regularization>, ) -> Self
Create a new composite objective
Trait Implementations§
Source§impl<'a> Debug for CompositeObjective<'a>
impl<'a> Debug for CompositeObjective<'a>
Source§impl<'a> Objective for CompositeObjective<'a>
impl<'a> Objective for CompositeObjective<'a>
Source§fn value(
&self,
coefficients: &Array1<Float>,
data: &ObjectiveData,
) -> Result<Float>
fn value( &self, coefficients: &Array1<Float>, data: &ObjectiveData, ) -> Result<Float>
Compute the objective value
Source§fn gradient(
&self,
coefficients: &Array1<Float>,
data: &ObjectiveData,
) -> Result<Array1<Float>>
fn gradient( &self, coefficients: &Array1<Float>, data: &ObjectiveData, ) -> Result<Array1<Float>>
Compute the gradient of the objective
Source§fn supports_hessian(&self) -> bool
fn supports_hessian(&self) -> bool
Check if the objective supports Hessian computation
Source§fn value_and_gradient(
&self,
coefficients: &Array1<Float>,
data: &ObjectiveData,
) -> Result<(Float, Array1<Float>)>
fn value_and_gradient( &self, coefficients: &Array1<Float>, data: &ObjectiveData, ) -> Result<(Float, Array1<Float>)>
Compute both value and gradient (often more efficient than separate calls)
Auto Trait Implementations§
impl<'a> Freeze for CompositeObjective<'a>
impl<'a> !RefUnwindSafe for CompositeObjective<'a>
impl<'a> Send for CompositeObjective<'a>
impl<'a> Sync for CompositeObjective<'a>
impl<'a> Unpin for CompositeObjective<'a>
impl<'a> !UnwindSafe for CompositeObjective<'a>
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> 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 more