Skip to content

Commit 09650b3

Browse files
committed
feat: allow users to skip Hessian calculation in L-BFGS-B algorithm
1 parent 89ba690 commit 09650b3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/algorithms/lbfgsb.rs

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ pub enum LBFGSBErrorMode {
4848
/// Computes the exact Hessian matrix via finite differences.
4949
#[default]
5050
ExactHessian,
51+
/// Skip Hessian computation (use this when error evaluation is not important).
52+
Skip,
5153
}
5254

5355
/// The L-BFGS (Limited memory Broyden-Fletcher-Goldfarb-Shanno) algorithm.
@@ -473,6 +475,7 @@ impl<U, E> Algorithm<U, E> for LBFGSB<U, E> {
473475
let hessian = func.hessian(self.x.as_slice(), user_data)?;
474476
status.set_hess(&hessian);
475477
}
478+
LBFGSBErrorMode::Skip => {}
476479
}
477480
Ok(())
478481
}

0 commit comments

Comments
 (0)