You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$$
\begin{align}
\mathbf{s}_k & = \mathbf{x}_{k+1} - \mathbf{x}_{k} \\
\mathbf{y}_k & = \nabla f(\mathbf{x}_{k+1}) - \nabla f(\mathbf{x}_{k})
\end{align}
$$
or using this following update:
$$
B_{k+1}^{-1} = (I - \frac{\mathbf{s}_k \mathbf{y}_k^T}{\mathbf{y}_k^T \mathbf{s}_k}) B_{k}^{-1} (I - \frac{\mathbf{s}_k \mathbf{y}_k^T}{\mathbf{y}_k^T \mathbf{s}_k}) + \frac{\mathbf{s}_k \mathbf{s}_k^T}{\mathbf{y}_k^T \mathbf{s}_k}
$$
Whichever formula we use, there is issue that $\mathbf{y}_k^T \mathbf{s}_k$ might be zero which would cause failure of the algorithm.
The solution in scipy.optimize._minimize_bfgs() is that if $\mathbf{y}_k^T \mathbf{s}_k = 0$, just let $(\mathbf{y}_k^T \mathbf{s}_k)^{-1} = 1000$ and give a warning.