macro_rules! adjust {
($target:expr, $i:expr, $v:expr, $lr:expr) => { ... };
}Expand description
adjust! is used to modify specific derivatives of a Point during the
optimization
$target is the specific derivative being adjusted (ex.xp,xpp,xppp,…)
$i: the index in the array v corresponding to the derivative being
adjusted
$v: A slice of Option<T> values representing how much to adjust each
derivative.
$lr: A learning rate that scales the adjustment.
if v[i] is Some, the adjustment is calculated as value*lr and
subtracted from the target.
if v[i] is None, it defaults to 0, meaning there is no adjustment for
that derivative.
So, to sum up, this macro applies a scaled adjustment to a derivative of the point if an adjustment value is provided.