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

Fix zoom to handle first trial infinite or NaN #465

Merged

Conversation

vroulet
Copy link
Collaborator

@vroulet vroulet commented Jul 4, 2023

If the first trial of the zoom linesearch was NaN, no valid stepsize was found (returned 0 as final stepsize) and the solver would then get stuck.
Fixed it by switching to zoom into 0 and first stepsize when a NaN or Inf is encountered during the search interval procedure.
Also fix the error to be inf even if it was nan. Otherwise the linesearch stops even if it could have further found a good stepsize.

Copy link
Collaborator

@mblondel mblondel left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @vroulet

@copybara-service copybara-service bot merged commit 404c518 into google:main Jul 5, 2023
zaccharieramzi added a commit to zaccharieramzi/jaxopt that referenced this pull request Jul 10, 2023
commit 8f8506d
Merge: 56dcd16 404c518
Author: Zaccharie Ramzi <zaccharie.ramzi@gmail.com>
Date:   Mon Jul 10 14:11:27 2023 +0200

    Merge branch 'main' into fix-broyden

commit 56dcd16
Author: Zaccharie Ramzi <zaccharie.ramzi@gmail.com>
Date:   Mon Jul 10 14:11:05 2023 +0200

    added broyden in common test + made sure it respects line search failure

commit 404c518
Merge: 22a4af9 aedcfd7
Author: JAXopt authors <no-reply@google.com>
Date:   Wed Jul 5 02:11:33 2023 -0700

    Merge pull request google#465 from vroulet:fix_zoom_max_stepsize_reached

    PiperOrigin-RevId: 545604666

commit 22a4af9
Merge: 9afa6f7 a5aada2
Author: JAXopt authors <no-reply@google.com>
Date:   Wed Jul 5 01:22:31 2023 -0700

    Merge pull request google#464 from phinate:fix-lbfgsb-grad

    PiperOrigin-RevId: 545594782

commit aedcfd7
Author: Vincent Roulet <vroulet@google.com>
Date:   Tue Jul 4 16:52:40 2023 +0200

    Fix zoom to handle first trial infinite or NaN

commit a5aada2
Author: Nathan Simpson <nsimpson@turing.ac.uk>
Date:   Tue Jul 4 10:45:07 2023 +0100

    add test

commit 52a4cf8
Author: Nathan Simpson <nsimpson@turing.ac.uk>
Date:   Tue Jul 4 10:39:24 2023 +0100

    set up correct signature, add _grad_fun

commit 9afa6f7
Merge: 4e80f27 d30a1d9
Author: JAXopt authors <no-reply@google.com>
Date:   Mon Jul 3 02:18:34 2023 -0700

    Merge pull request google#456 from Algue-Rythme:fixandersonaux

    PiperOrigin-RevId: 545162664

commit 4e80f27
Merge: fe57f15 924a1c1
Author: JAXopt authors <no-reply@google.com>
Date:   Fri Jun 30 02:45:07 2023 -0700

    Merge pull request google#458 from mblondel:weak_type_consistency

    PiperOrigin-RevId: 544601673

commit 924a1c1
Author: Mathieu Blondel <mblondel@google.com>
Date:   Thu Jun 29 14:40:59 2023 +0200

    Ensure weak-type consistency.

commit fe57f15
Merge: e6fbf5f 35d34c8
Author: JAXopt authors <no-reply@google.com>
Date:   Fri Jun 30 00:10:16 2023 -0700

    Merge pull request google#449 from vroulet:no_cond_in_zoom_linesearch

    PiperOrigin-RevId: 544574347

commit 35d34c8
Author: Vincent Roulet <vroulet@google.com>
Date:   Fri Jun 30 08:30:55 2023 +0200

    add cond in zoom and globally

commit e6fbf5f
Author: JAXopt authors <no-reply@google.com>
Date:   Thu Jun 29 14:11:31 2023 -0700

    Internal change

    PiperOrigin-RevId: 544458648

commit 5ff06fe
Merge: 7238f76 47c2d39
Author: JAXopt authors <no-reply@google.com>
Date:   Thu Jun 29 13:34:11 2023 -0700

    Merge pull request google#455 from Algue-Rythme:convenienceapi

    PiperOrigin-RevId: 544446827

commit 7238f76
Author: Fabian Pedregosa <pedregosa@google.com>
Date:   Thu Jun 29 08:00:34 2023 -0700

    Internal change

    PiperOrigin-RevId: 544357158

commit fddcada
Merge: 1572796 94ff4ec
Author: JAXopt authors <no-reply@google.com>
Date:   Thu Jun 29 06:55:01 2023 -0700

    Merge pull request google#457 from Algue-Rythme:docinterpolating

    PiperOrigin-RevId: 544343274

commit 47c2d39
Author: AlgueRythme <louis.bethune@ens-lyon.fr>
Date:   Thu Jun 29 12:14:04 2023 +0200

    Extend convenience API for QP + doc

commit 94ff4ec
Author: AlgueRythme <louis.bethune@ens-lyon.fr>
Date:   Thu Jun 29 14:21:39 2023 +0200

    Add interpolation explanations for Polyak/Armijo API doc

commit d30a1d9
Author: AlgueRythme <louis.bethune@ens-lyon.fr>
Date:   Thu Jun 29 14:08:25 2023 +0200

    support has_aux for AndersonAcceleration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants