API for Regularizers
This page contains documentation of the public API of the RegularizedLeastSquares. In the Julia REPL one can access this documentation by entering the help mode with ?
RegularizedLeastSquares.L1Regularization — Type
L1RegularizationRegularization term implementing the proximal map for the Lasso problem.
RegularizedLeastSquares.L2Regularization — Type
L2RegularizationRegularization term implementing the proximal map for Tikhonov regularization.
RegularizedLeastSquares.L21Regularization — Type
L21RegularizationRegularization term implementing the proximal map for group-soft-thresholding.
Arguments
λ- regularization paramter
Keywords
slices=1- number of elements per group
RegularizedLeastSquares.LLRRegularization — Type
LLRRegularizationRegularization term implementing the proximal map for locally low rank (LLR) regularization using singular-value-thresholding. Computation is always performed on the CPU. If the input is a GPU array, it is temporarily moved to the CPU.
Arguments
λ- regularization paramter
Keywords
shape::Tuple{Int}- dimensions of the imageblockSize::Tuple{Int}=(2,2)- size of patches to perform singular value thresholding onrandshift::Bool=true- randomly shifts the patches to ensure translation invariancefullyOverlapping::Bool=false- choose between fully overlapping block or non-overlapping blocks
RegularizedLeastSquares.NuclearRegularization — Type
NuclearRegularizationRegularization term implementing the proximal map for singular value soft-thresholding.
Arguments:
λ- regularization paramter
Keywords
svtShape::NTuple- size of the underlying matrix
RegularizedLeastSquares.TVRegularization — Type
TVRegularizationRegularization term implementing the proximal map for TV regularization. Calculated with the Condat algorithm if the TV is calculated only along one real-valued dimension and with the Fast Gradient Projection algorithm otherwise.
Reference for the Condat algorithm: https://lcondat.github.io/publis/Condat-fast_TV-SPL-2013.pdf
Reference for the FGP algorithm: A. Beck and T. Teboulle, "Fast Gradient-Based Algorithms for Constrained Total Variation Image Denoising and Deblurring Problems", IEEE Trans. Image Process. 18(11), 2009
Arguments
λ::T- regularization parameter
Keywords
shape::NTuple- size of the underlying imagedims- Dimension to perform the TV along. IfInteger, the Condat algorithm is called, and the FDG algorithm otherwise.iterationsTV=20- number of FGP iterations
Projection Regularization
RegularizedLeastSquares.PositiveRegularization — Type
PositiveRegularizationRegularization term implementing a projection onto positive and real numbers.
RegularizedLeastSquares.RealRegularization — Type
RealRegularizationRegularization term implementing a projection onto real numbers.
Nested Regularization
RegularizedLeastSquares.innerreg — Method
innerreg(reg::AbstractNestedRegularization)return the inner regularization term of reg. Nested regularization terms also implement the iteration interface.
RegularizedLeastSquares.sink — Method
sink(reg::AbstractNestedRegularization)return the innermost regularization term.
RegularizedLeastSquares.sinktype — Method
sinktype(reg::AbstractNestedRegularization)return the type of the innermost regularization term.
See also sink.
Scaled Regularization
RegularizedLeastSquares.AbstractScaledRegularization — Type
AbstractScaledRegularizationNested regularization term that applies a scalefactor to the regularization parameter λ of its inner term.
See also scalefactor, λ, innerreg.
RegularizedLeastSquares.scalefactor — Function
scalescalefactor(reg::AbstractScaledRegularization)return the scaling scalefactor for λ
RegularizedLeastSquares.NormalizedRegularization — Type
NormalizedRegularizationNested regularization term that scales λ according to normalization scheme. This term is commonly applied by a solver based on a given normalization keyword
#See also NoNormalization, MeasurementBasedNormalization, SystemMatrixBasedNormalization.
RegularizedLeastSquares.NoNormalization — Type
NoNormalizationNo normalization to λ is applied.
RegularizedLeastSquares.MeasurementBasedNormalization — Type
MeasurementBasedNormalizationλ is normalized by the 1-norm of b divided by its length.
RegularizedLeastSquares.SystemMatrixBasedNormalization — Type
SystemMatrixBasedNormalizationλ is normalized by the energy of the system matrix rows.
RegularizedLeastSquares.FixedParameterRegularization — Type
FixedParameterRegularizationNested regularization term that discards any λ passed to it and instead uses λ from its inner regularization term. This can be used to selectively disallow normalization.
Misc. Nested Regularization
RegularizedLeastSquares.MaskedRegularization — Type
MaskedRegularizationNested regularization term that only applies prox! and norm to elements of x for which the mask is true.
Examples
julia> positive = PositiveRegularization();
julia> masked = MaskedRegularization(reg, [true, false, true, false]);
julia> prox!(masked, fill(-1, 4))
4-element Vector{Float64}:
0.0
-1.0
0.0
-1.0RegularizedLeastSquares.TransformedRegularization — Type
TransformedRegularization(reg, trafo)Nested regularization term that applies prox! or norm on z = trafo * x and returns (inplace) x = adjoint(trafo) * z.
Example
julia> core = L1Regularization(0.8)
L1Regularization{Float64}(0.8)
julia> wop = WaveletOp(Float32, shape = (32,32));
julia> reg = TransformedRegularization(core, wop);
julia> prox!(reg, randn(32*32)); # Apply soft-thresholding in Wavelet domainRegularizedLeastSquares.PlugAndPlayRegularization — Type
PlugAndPlayRegularizationRegularization term implementing a given plug-and-play proximal mapping. The actual regularization term is indirectly defined by the learned proximal mapping and as such there is no norm implemented.
Arguments
λ- regularization paramter
Keywords
model- model applied to the imageshape- dimensions of the imageinput_transform- transform of image beforemodel
Miscellaneous Functions
RegularizedLeastSquares.prox! — Method
prox!(reg::AbstractParameterizedRegularization, x)perform the proximal mapping defined by reg on x. Uses the regularization parameter defined for reg.
RegularizedLeastSquares.prox! — Method
prox!(regType::Type{<:AbstractParameterizedRegularization}, x, λ; kwargs...)construct a regularization term of type regType with given λ and kwargs and apply its prox! on x
LinearAlgebra.norm — Method
norm(reg::AbstractParameterizedRegularization, x)returns the value of the reg regularization term on x. Uses the regularization parameter defined for reg.
RegularizedLeastSquares.λ — Method
λ(reg::AbstractParameterizedRegularization)return the regularization parameter λ of reg
LinearAlgebra.norm — Method
norm(regType::Type{<:AbstractParameterizedRegularization}, x, λ; kwargs...)construct a regularization term of type regType with given λ and kwargs and apply its norm on x