Struct argmin::core::OpWrapper [−][src]
pub struct OpWrapper<O: ArgminOp> { pub op: Option<O>, pub cost_func_count: u64, pub grad_func_count: u64, pub hessian_func_count: u64, pub jacobian_func_count: u64, pub modify_func_count: u64, }
Expand description
This wraps an operator and keeps track of how often the cost, gradient and Hessian have been computed and how often the modify function has been called. Usually, this is an implementation detail unless a solver is needed within another solver (such as a line search within a gradient descent method), then it may be necessary to wrap the operator in an OpWrapper.
Fields
op: Option<O>
Operator
cost_func_count: u64
Number of cost function evaluations
grad_func_count: u64
Number of gradient function evaluations
hessian_func_count: u64
Number of Hessian function evaluations
jacobian_func_count: u64
Number of Jacobian function evaluations
modify_func_count: u64
Number of modify
function evaluations
Implementations
Construct struct from other OpWrapper
. Takes the operator from op
(replaces it with
None
) and crates a new OpWrapper
Calls the apply
method of op
and increments cost_func_count
.
Calls the gradient
method of op
and increments gradient_func_count
.
Calls the hessian
method of op
and increments hessian_func_count
.
Calls the jacobian
method of op
and increments jacobian_func_count
.
Calls the modify
method of op
and increments modify_func_count
.
Moves the operator out of the struct and replaces it with None
Consumes an operator by increasing the function call counts of self
by the ones in
other
.
Adds function evaluation counts of another operator.
Trait Implementations
The OpWrapperArgminOp
Applies the operator/cost function to parameters
Computes the gradient at the given parameters
Computes the Hessian at the given parameters
Computes the Hessian at the given parameters
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl<O> RefUnwindSafe for OpWrapper<O> where
O: RefUnwindSafe,
impl<O> UnwindSafe for OpWrapper<O> where
O: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more