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

Add loss-based stopping criterion and line search to GradientBasedSolver #23

Merged
merged 3 commits into from
Jun 3, 2024

Conversation

dwmunster
Copy link
Contributor

Overview

Replaces the static step size with the Wolfe condition based line search for GradientBasedSolver. This typically leads to much larger accepted steps and faster convergence. This allows the GradientBasedSolver to successfully complete the CirclesWithLines benchmark even faster than BFGS, though it still fails for the largest StairsWithLines cases.

Benchmarks

From benchmark2:

Benchmark: CirclesWithLines
n:   30,        primitives:   59,       constraints:  88,       solver: GradientBasedSolver,    solved: true,   error: 0.00,    duration: 2ms
n:   30,        primitives:   59,       constraints:  88,       solver: BFGSSolver         ,    solved: true,   error: 0.00,    duration: 1ms
n:   50,        primitives:   99,       constraints: 148,       solver: GradientBasedSolver,    solved: true,   error: 0.00,    duration: 3ms
n:   50,        primitives:   99,       constraints: 148,       solver: BFGSSolver         ,    solved: true,   error: 0.00,    duration: 2ms
n:  100,        primitives:  199,       constraints: 298,       solver: GradientBasedSolver,    solved: true,   error: 0.00,    duration: 6ms
n:  100,        primitives:  199,       constraints: 298,       solver: BFGSSolver         ,    solved: true,   error: 0.00,    duration: 7ms
n:  300,        primitives:  599,       constraints: 898,       solver: GradientBasedSolver,    solved: true,   error: 0.00,    duration: 16ms
n:  300,        primitives:  599,       constraints: 898,       solver: BFGSSolver         ,    solved: true,   error: 0.00,    duration: 51ms
Benchmark: StairsWithLines
n:   30,        primitives:   59,       constraints:  59,       solver: GradientBasedSolver,    solved: false,  error: 0.00,    duration: 63ms
n:   30,        primitives:   59,       constraints:  59,       solver: BFGSSolver         ,    solved: true,   error: 0.00,    duration: 0ms
n:   50,        primitives:   99,       constraints:  99,       solver: GradientBasedSolver,    solved: false,  error: 0.00,    duration: 97ms
n:   50,        primitives:   99,       constraints:  99,       solver: BFGSSolver         ,    solved: true,   error: 0.00,    duration: 1ms
n:  100,        primitives:  199,       constraints: 199,       solver: GradientBasedSolver,    solved: false,  error: 1.10,    duration: 188ms
n:  100,        primitives:  199,       constraints: 199,       solver: BFGSSolver         ,    solved: true,   error: 0.00,    duration: 10ms
n:  300,        primitives:  599,       constraints: 599,       solver: GradientBasedSolver,    solved: false,  error: 29.68,   duration: 555ms
n:  300,        primitives:  599,       constraints: 599,       solver: BFGSSolver         ,    solved: true,   error: 0.00,    duration: 246ms

@TobiasJacob TobiasJacob merged commit 22f6bf8 into CADmium-Co:main Jun 3, 2024
0 of 5 checks passed
@dwmunster dwmunster deleted the feature/gradient-line-search branch June 4, 2024 03:01
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