Struct argmin::core::IterState[][src]

pub struct IterState<O: ArgminOp> {
Show 26 fields pub param: O::Param, pub prev_param: O::Param, pub best_param: O::Param, pub prev_best_param: O::Param, pub cost: O::Float, pub prev_cost: O::Float, pub best_cost: O::Float, pub prev_best_cost: O::Float, pub target_cost: O::Float, pub grad: Option<O::Param>, pub prev_grad: Option<O::Param>, pub hessian: Option<O::Hessian>, pub prev_hessian: Option<O::Hessian>, pub jacobian: Option<O::Jacobian>, pub prev_jacobian: Option<O::Jacobian>, pub population: Option<Vec<(O::Param, O::Float)>>, pub iter: u64, pub last_best_iter: u64, pub max_iters: u64, 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, pub time: Option<Duration>, pub termination_reason: TerminationReason,
}
Expand description

Maintains the state from iteration to iteration of a solver

Fields

param: O::Param

Current parameter vector

prev_param: O::Param

Previous parameter vector

best_param: O::Param

Current best parameter vector

prev_best_param: O::Param

Previous best parameter vector

cost: O::Float

Current cost function value

prev_cost: O::Float

Previous cost function value

best_cost: O::Float

Current best cost function value

prev_best_cost: O::Float

Previous best cost function value

target_cost: O::Float

Target cost function value

grad: Option<O::Param>

Current gradient

prev_grad: Option<O::Param>

Previous gradient

hessian: Option<O::Hessian>

Current Hessian

prev_hessian: Option<O::Hessian>

Previous Hessian

jacobian: Option<O::Jacobian>

Current Jacobian

prev_jacobian: Option<O::Jacobian>

Previous Jacobian

population: Option<Vec<(O::Param, O::Float)>>

All members for population-based algorithms as (param, cost) tuples

iter: u64

Current iteration

last_best_iter: u64

Iteration number of last best cost

max_iters: u64

Maximum number of iterations

cost_func_count: u64

Number of cost function evaluations so far

grad_func_count: u64

Number of gradient evaluations so far

hessian_func_count: u64

Number of Hessian evaluations so far

jacobian_func_count: u64

Number of Jacobian evaluations so far

modify_func_count: u64

Number of modify evaluations so far

time: Option<Duration>

Time required so far

termination_reason: TerminationReason

Reason of termination

Implementations

Create new IterState from param

Set parameter vector. This shifts the stored parameter vector to the previous parameter vector.

Set best paramater vector. This shifts the stored best parameter vector to the previous best parameter vector.

Set the current cost function value. This shifts the stored cost function value to the previous cost function value.

Set the current best cost function value. This shifts the stored best cost function value to the previous cost function value.

Set gradient. This shifts the stored gradient to the previous gradient.

Set Hessian. This shifts the stored Hessian to the previous Hessian.

Set Jacobian. This shifts the stored Jacobian to the previous Jacobian.

Set population

Set target cost value

Set maximum number of iterations

Set iteration number where the previous best parameter vector was found

Set termination_reason

Set time required so far

Returns current parameter vector

Returns previous parameter vector

Returns best parameter vector

Returns previous best parameter vector

Returns current cost function value

Returns previous cost function value

Returns current best cost function value

Returns previous best cost function value

Returns target cost

Returns current cost function evaluation count

Returns current gradient function evaluation count

Returns current Hessian function evaluation count

Returns current Jacobian function evaluation count

Returns current Modify function evaluation count

Returns iteration number where the last best parameter vector was found

Get termination_reason

Get time required so far

Returns gradient

Returns previous gradient

Returns current Hessian

Returns previous Hessian

Returns current Jacobian

Returns previous Jacobian

Returns current number of iterations

Returns maximum number of iterations

Returns population

Increment the number of iterations by one

Increment all function evaluation counts by the evaluation counts of another operator wrapped in OpWrapper.

Set all function evaluation counts to the evaluation counts of another operator wrapped in OpWrapper.

Increment cost function evaluation count by num

Increment gradient function evaluation count by num

Increment Hessian function evaluation count by num

Increment Jacobian function evaluation count by num

Increment modify function evaluation count by num

Indicate that a new best parameter vector was found

Returns whether the current parameter vector is also the best parameter vector found so far.

Return whether the algorithm has terminated or not

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize self into Serializer Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.