|
45 | 45 | const bp_candes = candes_reweighting |
46 | 46 |
|
47 | 47 | # using LinearAlgebraExtensions: LowRank |
48 | | -# TODO: stop when w has converged, instead of maxiter |
| 48 | +# IDEA: stop when w has converged, instead of maxiter |
49 | 49 | function ard_weights!(w, A, x, ε::Real, iter::Int = 8) |
50 | 50 | if any(==(0), w) |
51 | 51 | error("weights cannot be zero") |
52 | 52 | 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 ... |
54 | 54 | # Ai = @view A[:, nzind] |
55 | 55 | # wx = @. abs(x.nzval) / w[nzind] |
56 | 56 | # K = Woodbury(ε*I(size(A, 1)), Ai, WX, Ai') |
|
66 | 66 |
|
67 | 67 | ard_function(A::AbstractMatrix, ε::Real) = (w, x) -> ard_weights!(w, A, x, ε) |
68 | 68 |
|
| 69 | +# IDEA: generalize for general objectives via Jacobian (linearization) |
69 | 70 | function ard_reweighting(A::AbstractMatrix, b::AbstractVector, ε::Real = 1e-2; |
70 | 71 | maxiter::Int = 8) |
71 | 72 | basispursuit_reweighting(A, b, ard_function(A, ε), maxiter = maxiter) |
|
137 | 138 |
|
138 | 139 | ################################ (F)ISTA ######################################## |
139 | 140 | struct FISTA end |
140 | | -# TODO: use homotopy to select appropriate λ |
| 141 | +# IDEA: use homotopy to select appropriate λ |
141 | 142 |
|
142 | 143 | # shrinkage and thresholding operator |
143 | 144 | shrinkage(x::Real, α::Real) = sign(x) * max(abs(x)-α, zero(x)) |
|
0 commit comments