Function consprob_trained::bfgs
source · pub fn bfgs<F, G>(
x0: ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
f: F,
g: G
) -> Result<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, ()>where
F: Fn(&ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>) -> f64,
G: Fn(&ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>) -> ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>,
Expand description
Returns a value of x
that should minimize f
. f
must be convex and twice-differentiable.
x0
is an initial guess forx
. Often this is chosen randomly.f
is the objective functiong
is the gradient off