Skip to content

Commit

Permalink
fix default lambda type to be real valued
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobAsslaender committed Jan 2, 2024
1 parent 4692422 commit de21d86
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/ADMM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ mutable struct ADMM{matT,opT,R,ropT,P,vecT,rvecT,preconT,rT} <: AbstractPrimalDu
end

"""
ADMM(A; AHA = A'*A, precon = Identity(), reg = L1Regularization(zero(eltype(AHA))), normalizeReg = NoNormalization(), rho = 1e-1, vary_rho = :none, iterations = 10, iterationsCG = 10, absTol = eps(real(eltype(AHA))), relTol = eps(real(eltype(AHA))), tolInner = 1e-5, verbose = false)
ADMM( ; AHA = , precon = Identity(), reg = L1Regularization(zero(eltype(AHA))), normalizeReg = NoNormalization(), rho = 1e-1, vary_rho = :none, iterations = 10, iterationsCG = 10, absTol = eps(real(eltype(AHA))), relTol = eps(real(eltype(AHA))), tolInner = 1e-5, verbose = false)
ADMM(A; AHA = A'*A, precon = Identity(), reg = L1Regularization(zero(real(eltype(AHA)))), normalizeReg = NoNormalization(), rho = 1e-1, vary_rho = :none, iterations = 10, iterationsCG = 10, absTol = eps(real(eltype(AHA))), relTol = eps(real(eltype(AHA))), tolInner = 1e-5, verbose = false)
ADMM( ; AHA = , precon = Identity(), reg = L1Regularization(zero(real(eltype(AHA)))), normalizeReg = NoNormalization(), rho = 1e-1, vary_rho = :none, iterations = 10, iterationsCG = 10, absTol = eps(real(eltype(AHA))), relTol = eps(real(eltype(AHA))), tolInner = 1e-5, verbose = false)
Creates an `ADMM` object for the forward operator `A` or normal operator `AHA`.
Expand Down Expand Up @@ -71,7 +71,7 @@ ADMM(; AHA, kwargs...) = ADMM(nothing; kwargs..., AHA = AHA)
function ADMM(A
; AHA = A'*A
, precon = Identity()
, reg = L1Regularization(zero(eltype(AHA)))
, reg = L1Regularization(zero(real(eltype(AHA))))
, normalizeReg::AbstractRegularizationNormalization = NoNormalization()
, rho = 1e-1
, vary_rho::Symbol = :none
Expand Down
6 changes: 3 additions & 3 deletions src/FISTA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ mutable struct FISTA{rT <: Real, vecT <: Union{AbstractVector{rT}, AbstractVecto
end

"""
FISTA(A; AHA=A'*A, reg=L1Regularization(zero(eltype(AHA))), normalizeReg=NoNormalization(), rho=0.95, normalize_rho=true, theta=1, relTol=eps(real(eltype(AHA))), iterations=50, restart = :none, verbose = false)
FISTA( ; AHA=, reg=L1Regularization(zero(eltype(AHA))), normalizeReg=NoNormalization(), rho=0.95, normalize_rho=true, theta=1, relTol=eps(real(eltype(AHA))), iterations=50, restart = :none, verbose = false)
FISTA(A; AHA=A'*A, reg=L1Regularization(zero(real(eltype(AHA)))), normalizeReg=NoNormalization(), rho=0.95, normalize_rho=true, theta=1, relTol=eps(real(eltype(AHA))), iterations=50, restart = :none, verbose = false)
FISTA( ; AHA=, reg=L1Regularization(zero(real(eltype(AHA)))), normalizeReg=NoNormalization(), rho=0.95, normalize_rho=true, theta=1, relTol=eps(real(eltype(AHA))), iterations=50, restart = :none, verbose = false)
creates a `FISTA` object for the forward operator `A` or normal operator `AHA`.
Expand Down Expand Up @@ -51,7 +51,7 @@ FISTA(; AHA, kwargs...) = FISTA(nothing; AHA = AHA, kwargs...)

function FISTA(A
; AHA = A'*A
, reg = L1Regularization(zero(eltype(AHA)))
, reg = L1Regularization(zero(real(eltype(AHA))))
, normalizeReg = NoNormalization()
, rho = 0.95
, normalize_rho = true
Expand Down
6 changes: 3 additions & 3 deletions src/OptISTA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ mutable struct OptISTA{rT <: Real, vecT <: Union{AbstractVector{rT}, AbstractVec
end

"""
OptISTA(A; AHA=A'*A, reg=L1Regularization(zero(eltype(AHA))), normalizeReg=NoNormalization(), rho=0.95, normalize_rho=true, theta=1, relTol=eps(real(eltype(AHA))), iterations=50, verbose = false)
OptISTA( ; AHA=, reg=L1Regularization(zero(eltype(AHA))), normalizeReg=NoNormalization(), rho=0.95, normalize_rho=true, theta=1, relTol=eps(real(eltype(AHA))), iterations=50, verbose = false)
OptISTA(A; AHA=A'*A, reg=L1Regularization(zero(real(eltype(AHA)))), normalizeReg=NoNormalization(), rho=0.95, normalize_rho=true, theta=1, relTol=eps(real(eltype(AHA))), iterations=50, verbose = false)
OptISTA( ; AHA=, reg=L1Regularization(zero(real(eltype(AHA)))), normalizeReg=NoNormalization(), rho=0.95, normalize_rho=true, theta=1, relTol=eps(real(eltype(AHA))), iterations=50, verbose = false)
creates a `OptISTA` object for the forward operator `A` or normal operator `AHA`. OptISTA has a 2x better worst-case bound than FISTA, but actual performance varies by application. It stores 2 extra intermediate variables the size of the image compared to FISTA.
Expand Down Expand Up @@ -57,7 +57,7 @@ OptISTA(; AHA, kwargs...) = OptISTA(nothing; AHA = AHA, kwargs...)

function OptISTA(A
; AHA = A'*A
, reg = L1Regularization(zero(eltype(AHA)))
, reg = L1Regularization(zero(real(eltype(AHA))))
, normalizeReg = NoNormalization()
, rho = 0.95
, normalize_rho = true
Expand Down
6 changes: 3 additions & 3 deletions src/POGM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ mutable struct POGM{rT<:Real,vecT<:Union{AbstractVector{rT},AbstractVector{Compl
end

"""
POGM(A; AHA = A'*A, reg = L1Regularization(zero(eltype(AHA))), normalizeReg = NoNormalization(), rho = 0.95, normalize_rho = true, theta = 1, sigma_fac = 1, relTol = eps(real(eltype(AHA))), iterations = 50, restart = :none, verbose = false)
POGM( ; AHA = , reg = L1Regularization(zero(eltype(AHA))), normalizeReg = NoNormalization(), rho = 0.95, normalize_rho = true, theta = 1, sigma_fac = 1, relTol = eps(real(eltype(AHA))), iterations = 50, restart = :none, verbose = false)
POGM(A; AHA = A'*A, reg = L1Regularization(zero(real(eltype(AHA)))), normalizeReg = NoNormalization(), rho = 0.95, normalize_rho = true, theta = 1, sigma_fac = 1, relTol = eps(real(eltype(AHA))), iterations = 50, restart = :none, verbose = false)
POGM( ; AHA = , reg = L1Regularization(zero(real(eltype(AHA)))), normalizeReg = NoNormalization(), rho = 0.95, normalize_rho = true, theta = 1, sigma_fac = 1, relTol = eps(real(eltype(AHA))), iterations = 50, restart = :none, verbose = false)
Creates a `POGM` object for the forward operator `A` or normal operator `AHA`. POGM has a 2x better worst-case bound than FISTA, but actual performance varies by application. It stores 3 extra intermediate variables the size of the image compared to FISTA. Only gradient restart scheme is implemented for now.
Expand Down Expand Up @@ -71,7 +71,7 @@ POGM(; AHA, kwargs...) = POGM(nothing; kwargs..., AHA = AHA)

function POGM(A
; AHA = A'*A
, reg = L1Regularization(zero(eltype(AHA)))
, reg = L1Regularization(zero(real(eltype(AHA))))
, normalizeReg = NoNormalization()
, rho = 0.95
, normalize_rho = true
Expand Down
6 changes: 3 additions & 3 deletions src/SplitBregman.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ mutable struct SplitBregman{matT,opT,R,ropT,P,vecT,rvecT,preconT,rT} <: Abstract
end

"""
SplitBregman(A; AHA = A'*A, precon = Identity(), reg = L1Regularization(zero(eltype(AHA))), normalizeReg = NoNormalization(), rho = 1e-1, iterations = 1, iterationsInner = 10, iterationsCG = 10, absTol = eps(real(eltype(AHA))), relTol = eps(real(eltype(AHA))), tolInner = 1e-5, verbose = false)
SplitBregman( ; AHA = , precon = Identity(), reg = L1Regularization(zero(eltype(AHA))), normalizeReg = NoNormalization(), rho = 1e-1, iterations = 1, iterationsInner = 10, iterationsCG = 10, absTol = eps(real(eltype(AHA))), relTol = eps(real(eltype(AHA))), tolInner = 1e-5, verbose = false)
SplitBregman(A; AHA = A'*A, precon = Identity(), reg = L1Regularization(zero(real(eltype(AHA)))), normalizeReg = NoNormalization(), rho = 1e-1, iterations = 1, iterationsInner = 10, iterationsCG = 10, absTol = eps(real(eltype(AHA))), relTol = eps(real(eltype(AHA))), tolInner = 1e-5, verbose = false)
SplitBregman( ; AHA = , precon = Identity(), reg = L1Regularization(zero(real(eltype(AHA)))), normalizeReg = NoNormalization(), rho = 1e-1, iterations = 1, iterationsInner = 10, iterationsCG = 10, absTol = eps(real(eltype(AHA))), relTol = eps(real(eltype(AHA))), tolInner = 1e-5, verbose = false)
Creates a `SplitBregman` object for the forward operator `A` or normal operator `AHA`.
Expand Down Expand Up @@ -71,7 +71,7 @@ SplitBregman(; AHA, kwargs...) = SplitBregman(nothing; kwargs..., AHA = AHA)
function SplitBregman(A
; AHA = A'*A
, precon = Identity()
, reg = L1Regularization(zero(eltype(AHA)))
, reg = L1Regularization(zero(real(eltype(AHA))))
, normalizeReg::AbstractRegularizationNormalization = NoNormalization()
, rho = 1e-1
, iterations::Int = 1
Expand Down
2 changes: 1 addition & 1 deletion test/testKaczmarz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ end
λ = rand(1)
regMatrix = rand(N)

@show A, x, regMatrix
# @show A, x, regMatrix
# use regularization matrix

S = createLinearSolver(solver, A, iterations=100, regMatrix=regMatrix)
Expand Down

0 comments on commit de21d86

Please sign in to comment.