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

[breaking] Remove ConstraintTransformRegularization #70

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
docstring beautifying
JakobAsslaender committed Jan 2, 2024
commit 0ec3f2b251823ed068bac2d455d151c9e54f0e6a
2 changes: 1 addition & 1 deletion src/SplitBregman.jl
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ Creates a `SplitBregman` object for the forward operator `A` or normal operator
* `tolInner::Real` - relative tolerance for CG stopping criterion
* `verbose::Bool` - print residual in each iteration

This algorithm solves the constraint problem (Eq. (4.7) in [Tom Goldstein and Stanley Osher](https://doi.org/10.1137/080725891)), i.e. ||R(x)||_1 such that ||Ax -b||_2^2 < σ^2. In order to solve the unconstraint problem (Eq. (4.8) in [Tom Goldstein and Stanley Osher](https://doi.org/10.1137/080725891)), i.e. ||Ax -b||_2^2 + λ ||R(x)||_1, you can either set `iterationsOuter=1` or use ADMM instead, which is equivalent (`iterationsOuter=1` in SplitBregman in implied in ADMM and the SplitBregman variable `iterationsInner` is simply called `iterations` in ADMM)
This algorithm solves the constraint problem (Eq. (4.7) in [Tom Goldstein and Stanley Osher](https://doi.org/10.1137/080725891)), i.e. `||R(x)||₁` such that `||Ax -b||₂² < σ²`. In order to solve the unconstraint problem (Eq. (4.8) in [Tom Goldstein and Stanley Osher](https://doi.org/10.1137/080725891)), i.e. `||Ax -b||₂² + λ ||R(x)||₁`, you can either set `iterationsOuter=1` or use ADMM instead, which is equivalent (`iterationsOuter=1` in SplitBregman in implied in ADMM and the SplitBregman variable `iterationsInner` is simply called `iterations` in ADMM)

Like ADMM, SplitBregman differs from ISTA-type algorithms in the sense that the proximal operation is applied separately from the transformation to the space in which the penalty is applied. This is reflected by the interface which has `reg` and `regTrafo` as separate arguments. E.g., for a TV penalty, you should NOT set `reg=TVRegularization`, but instead use `reg=L1Regularization(λ), regTrafo=RegularizedLeastSquares.GradientOp(Float64; shape=(Nx,Ny,Nz))`.


Unchanged files with check annotations Beta

if reg[1] isa L1Regularization
gradientOp = opEye(T,N) #UniformScaling(one(T))
elseif reg[1] isa TVRegularization

Check warning on line 57 in src/PrimalDualSolver.jl

Codecov / codecov/patch

src/PrimalDualSolver.jl#L57

Added line #L57 was not covered by tests
gradientOp = gradientOperator(T,shape)
end
@deprecate createLinearSolver(solver, A, x; kargs...) createLinearSolver(solver, A; kargs...)
function Base.vec(reg::AbstractRegularization)
Base.depwarn("vec(reg::AbstractRegularization) will be removed in a future release. Use `reg = isa(reg, AbstractVector) ? reg : [reg]` instead.", reg; force=true)
return AbstractRegularization[reg]

Check warning on line 5 in src/deprecated.jl

Codecov / codecov/patch

src/deprecated.jl#L3-L5

Added lines #L3 - L5 were not covered by tests
end
function Base.vec(reg::AbstractVector{AbstractRegularization})
Base.depwarn("vec(reg::AbstractRegularization) will be removed in a future release. Use reg = `isa(reg, AbstractVector) ? reg : [reg]` instead.", reg; force=true)
return reg

Check warning on line 10 in src/deprecated.jl

Codecov / codecov/patch

src/deprecated.jl#L8-L10

Added lines #L8 - L10 were not covered by tests
end
export ConstraintTransformedRegularization
function ConstraintTransformedRegularization(args...)
error("ConstraintTransformedRegularization has been removed. ADMM and SplitBregman now take the regularizer and the transform as separat inputs.")

Check warning on line 15 in src/deprecated.jl

Codecov / codecov/patch

src/deprecated.jl#L14-L15

Added lines #L14 - L15 were not covered by tests
end