Skip to content

Check handling of convergence criteria in tao_pounders #505

Closed

Description

@janosg

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.

Activity

  1. added
    enhancement
    on Jul 19, 2024
  2. janosg commented on Nov 16, 2026

    @janosg
    MemberAuthor

    Fixed in #739

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions