Skip to content
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

correct convergence criterion for GW #566

Merged
merged 2 commits into from
Jul 30, 2024
Merged

correct convergence criterion for GW #566

merged 2 commits into from
Jul 30, 2024

Conversation

marcocuturi
Copy link
Contributor

Entropic GW convergence was testing

jnp.logical_and(
        iteration < self.max_iterations, jnp.all(out.linear_convergence)
    )

This is wrong, because out.linear_convergence was allocated by default a vector of max_iterations values set at -1. Therefore, if the solver stops before max_iterations, the remaining entries were set at -1 and the bool was necessarily False (note that given the first test above, when stopping at max_iterations, the value was also False).

The flag was therefore always False.

The modification proposes to populate instead with Nan values and check that jnp.nanmean is 1.0.

@michalk8 michalk8 merged commit 7bfbbcd into main Jul 30, 2024
11 of 12 checks passed
@michalk8 michalk8 deleted the gw_conv branch July 30, 2024 14:41
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