Skip to content

Commit c29e9ba

Browse files
Merge branch 'main' into compathelper/new_version/2022-02-23-00-26-03-176-01601683381
2 parents 9968d7e + de7038c commit c29e9ba

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "CompressedSensing"
22
uuid = "adc28fdd-7b77-41a2-89a7-a1a193b336a0"
33
authors = ["Sebastian Ament <[email protected]>"]
4-
version = "1.0.0"
4+
version = "1.0.1"
55

66
[deps]
77
Clp = "e2554f3b-3117-50c0-817c-e040a3ddf72d"
@@ -16,9 +16,9 @@ UpdatableQRFactorizations = "8b110c62-ada2-4dd7-b53a-29f29fe8f7f4"
1616
WoodburyFactorizations = "9f1bac23-581c-4ebc-bd36-df60d764636d"
1717

1818
[compat]
19-
Clp = "0.9"
19+
Clp = "0.9, 1"
2020
ECOS = "0.14, 1"
21-
JuMP = "0.22"
21+
JuMP = "0.22, 0.23"
2222
LazyInverses = "1.1"
2323
StatsBase = "0.33"
2424
UpdatableQRFactorizations = "1.0"

src/basispursuit.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ end
4545
const bp_candes = candes_reweighting
4646

4747
# using LinearAlgebraExtensions: LowRank
48-
# TODO: stop when w has converged, instead of maxiter
48+
# IDEA: stop when w has converged, instead of maxiter
4949
function ard_weights!(w, A, x, ε::Real, iter::Int = 8)
5050
if any(==(0), w)
5151
error("weights cannot be zero")
5252
end
53-
# nzind = x.nzind # this could speed up the weight computation
53+
# nzind = x.nzind # this could speed up the weight computation, could also drop zeros from model before reweighting ...
5454
# Ai = @view A[:, nzind]
5555
# wx = @. abs(x.nzval) / w[nzind]
5656
# K = Woodbury(ε*I(size(A, 1)), Ai, WX, Ai')
@@ -66,6 +66,7 @@ end
6666

6767
ard_function(A::AbstractMatrix, ε::Real) = (w, x) -> ard_weights!(w, A, x, ε)
6868

69+
# IDEA: generalize for general objectives via Jacobian (linearization)
6970
function ard_reweighting(A::AbstractMatrix, b::AbstractVector, ε::Real = 1e-2;
7071
maxiter::Int = 8)
7172
basispursuit_reweighting(A, b, ard_function(A, ε), maxiter = maxiter)
@@ -137,7 +138,7 @@ end
137138

138139
################################ (F)ISTA ########################################
139140
struct FISTA end
140-
# TODO: use homotopy to select appropriate λ
141+
# IDEA: use homotopy to select appropriate λ
141142

142143
# shrinkage and thresholding operator
143144
shrinkage(x::Real, α::Real) = sign(x) * max(abs(x)-α, zero(x))

src/matchingpursuit.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function omp(A::AbstractMatOrFac, b::AbstractVector, k::Int)
8686
end
8787

8888
function omp(A::AbstractMatOrFac, b::AbstractVector;
89-
max_residual = eps(eltype(A)), sparsity = size(A, 2))
89+
max_residual = eps(eltype(A)), sparsity = min(size(A)...))
9090
omp(A, b, max_residual, sparsity)
9191
end
9292

0 commit comments

Comments
 (0)