Skip to content

Commit

Permalink
Implement a proximal point state.
Browse files Browse the repository at this point in the history
  • Loading branch information
kellertuer committed Sep 3, 2024
1 parent fe06c6b commit 158f99b
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Manopt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ include("solvers/LevenbergMarquardt.jl")
include("solvers/particle_swarm.jl")
include("solvers/primal_dual_semismooth_Newton.jl")
include("solvers/proximal_bundle_method.jl")
include("solvers/prorimal_point.jl")
include("solvers/quasi_Newton.jl")
include("solvers/truncated_conjugate_gradient_descent.jl")
include("solvers/trust_regions.jl")
Expand Down
67 changes: 67 additions & 0 deletions src/solvers/proximal_point.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#
#
# State
"""
ProximalPointState{P} <: AbstractGradientSolverState
# Fields
$(_var(:Field, :p; add=[:as_Iterate]))
$(_var(:Field, :stopping_criterion, "stop"))
# Constructor
ProximalPointState(M::AbstractManifold; kwargs...)
Initialize the proximal point method solver state, where
## Input
$(_var(:Argument, :M; type=true))
## Keyword arguments
$(_var(:Keyword, :p; add=:as_Initial))
$(_var(:Keyword, :stopping_criterion; default="[`StopAfterIteration`](@ref)`(100)`"))
# See also
[`proximal point`](@ref)
"""
mutable struct ProximalPointState{
P,
TStop<:StoppingCriterion,
} <: AbstractGradientSolverState
p::P
stop::TStop
end
function ProximalPointState(
M::AbstractManifold;
p::P=rand(M),
stopping_criterion::SC=StopAfterIteration(200),
) where {
P,
SC<:StoppingCriterion,
}
return ProximalPointState{P,SC}(p, stopping_criterion)
end
function get_message(pps::ProximalPointState)
return get_message(pps.stepsize)
end
function show(io::IO, gds::ProximalPointState)
i = get_count(gds, :Iterations)
Iter = (i > 0) ? "After $i iterations\n" : ""
Conv = indicates_convergence(gds.stop) ? "Yes" : "No"
s = """
# Solver state for `Manopt.jl`s Proximal POint Method
$Iter
## Stopping criterion
$(status_summary(gds.stop))
This indicates convergence: $Conv"""
return print(io, s)
end
#
#
# solver interface

0 comments on commit 158f99b

Please sign in to comment.