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

Check handling of convergence criteria in tao_pounders #505

Open
janosg opened this issue Jul 19, 2024 · 0 comments
Open

Check handling of convergence criteria in tao_pounders #505

janosg opened this issue Jul 19, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@janosg
Copy link
Member

janosg commented Jul 19, 2024

Problem

tao_pounders has three gradient based convergence criteria that all have default values. They are processed in the following code snippet:

# Set user defined convergence tests. Beware that specifying multiple tests could
# overwrite others or lead to unclear behavior.
if stopping_maxiter is not None:
    tao.setConvergenceTest(functools.partial(_max_iters, stopping_maxiter))
elif convergence_gtol_scaled is False and convergence_gtol_abs is False:
    tao.setConvergenceTest(functools.partial(_grtol_conv, convergence_gtol_rel))
elif convergence_gtol_rel is False and convergence_gtol_scaled is False:
    tao.setConvergenceTest(functools.partial(_gatol_conv, convergence_gtol_abs))
elif convergence_gtol_scaled is False:
    tao.setConvergenceTest(
        functools.partial(
            _grtol_gatol_conv,
            convergence_gtol_rel,
            convergence_gtol_abs,
        )
    )

There are two potential problems:

  1. The if conditions don't use is True but just a check for truthyness. This could lead to unexpected behavior.
  2. It seems like by default all of the convergence criteria are active, even though the comment says that this can lead to unexpected behavior.
@janosg janosg added the enhancement New feature or request label Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant