Skip to content

Correct BFGS update #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 14, 2025
Merged

Correct BFGS update #27

merged 2 commits into from
May 14, 2025

Conversation

timothy-nunn
Copy link
Collaborator

Having looked again into the maths behind VMCON, @mkovari pointed out that the implementation of the hessian matrix revision may be incorrect.

From the Crane report
image
(NOTE: the denominator of the second term should be $\xi^T\gamma$)

The calculation of $\gamma\gamma^T$ and $\xi\xi^T$ are doing an outer product which is different from the current implementation.

I have corrected the update formula and added a test that uses reference values from the original Crane implementation. These tests did not pass on our old implementation (using matrix multiplication) but do pass following my changes in vmcon.py (to use np.outer).

@timothy-nunn timothy-nunn self-assigned this Apr 14, 2025
@timothy-nunn timothy-nunn marked this pull request as ready for review April 14, 2025 16:11
@mkovari
Copy link

mkovari commented Apr 15, 2025

Have you checked whether B is symmetric?

@mkovari
Copy link

mkovari commented Apr 15, 2025

Can you say something about what tests you have carried out? I can't seem to learn anything from the "Checks" tab.

@timothy-nunn
Copy link
Collaborator Author

Have you checked whether B is symmetric?

Within the tests I have added, there is a check for symmetry (up to 14 dp)

Can you say something about what tests you have carried out? I can't seem to learn anything from the "Checks" tab.

Most of these checks assert that PyVMCON is able to solve the example problems in the Crane report and produces (near) identical numeric results. I have also checked and this changes causes no differences to any of the PROCESS regression tests except for one (ST) that converges on a slightly different optima.

@timothy-nunn timothy-nunn requested a review from mkovari April 15, 2025 14:51
Copy link

@mkovari mkovari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonmaddock I would be interested to see what effect this has on your convergence studies.

@timothy-nunn timothy-nunn merged commit 3bb42a3 into main May 14, 2025
20 checks passed
@timothy-nunn timothy-nunn deleted the correct-bfgs branch May 16, 2025 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants