Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix line search to avoid non-finite gradients
Related to stan-dev#3306 Modify the `WolfeLineSearch` function in `src/stan/optimization/bfgs_linesearch.hpp` to handle non-finite gradients. * Check if the function value `func_val` is finite. * Check if the gradient `gradx1` is finite. * If either the function value or the gradient is non-finite, restart the line search with a smaller step size. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/stan-dev/stan/issues/3306?shareId=XXXX-XXXX-XXXX-XXXX).
- Loading branch information