Skip to content

Commit

Permalink
fix ALM; test on Julia 1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszbaran committed Dec 29, 2023
1 parent 3091c08 commit 546be06
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: ["1.6", "1.8", "1.9"]
julia-version: ["1.6", "1.9", "1.10"]
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v4
Expand Down
16 changes: 8 additions & 8 deletions src/solvers/augmented_Lagrangian_method.jl
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ function augmented_Lagrangian_method!(
evaluation::AbstractEvaluationType=AllocatingEvaluation(),
ϵ::Real=1e-3,
ϵ_min::Real=1e-6,
ϵ_exponent=1 / 100,
θ_ϵ=(ϵ_min / ϵ)^(ϵ_exponent),
ϵ_exponent::Real=1 / 100,
θ_ϵ::Real=(ϵ_min / ϵ)^(ϵ_exponent),
μ::Vector=ones(length(get_inequality_constraints(M, cmo, p))),
μ_max::Real=20.0,
λ::Vector=ones(length(get_equality_constraints(M, cmo, p))),
Expand All @@ -332,9 +332,9 @@ function augmented_Lagrangian_method!(
sub_cost=AugmentedLagrangianCost(cmo, ρ, μ, λ),
sub_grad=AugmentedLagrangianGrad(cmo, ρ, μ, λ),
sub_kwargs=(;),
sub_stopping_criterion=StopAfterIteration(300) |
StopWhenGradientNormLess(ϵ) |
StopWhenStepsizeLess(1e-8),
sub_stopping_criterion::StoppingCriterion=StopAfterIteration(300) |
StopWhenGradientNormLess(ϵ) |
StopWhenStepsizeLess(1e-8),
sub_state::AbstractManoptSolverState=decorate_state!(
QuasiNewtonState(
M,
Expand All @@ -359,9 +359,9 @@ function augmented_Lagrangian_method!(
sub_kwargs...,
),
),
stopping_criterion::StoppingCriterion=StopAfterIteration(300) | (
StopWhenSmallerOrEqual(, ϵ_min) & StopWhenChangeLess(1e-10)
),
stopping_criterion::StoppingCriterion=StopAfterIteration(300) |
StopWhenSmallerOrEqual(, ϵ_min) |
StopWhenChangeLess(1e-10),
kwargs...,
) where {O<:Union{ConstrainedManifoldObjective,AbstractDecoratedManifoldObjective}}
alms = AugmentedLagrangianMethodState(
Expand Down
21 changes: 0 additions & 21 deletions test/solvers/test_augmented_lagrangian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,6 @@ using LinearAlgebra: I, tr
p0 = project(M, ones(d))
sol = augmented_Lagrangian_method(M, f, grad_f, p0; g=g, grad_g=grad_g)
@test distance(M, sol, v0) < 8 * 1e-4
if isnan(distance(M, sol, v0))
print(sol)
augmented_Lagrangian_method(
M,
f,
grad_f,
p0;
g=g,
grad_g=grad_g,
debug=[
:Iteration,
:Cost,
:Stop,
:Iterate,
" | ",
(:Change, "Δp : %1.5e"),
1,
"\n",
],
)
end
sol2 = copy(M, p0)
augmented_Lagrangian_method!(M, f, grad_f, sol2; g=g, grad_g=grad_g)
@test sol2 == sol
Expand Down

0 comments on commit 546be06

Please sign in to comment.