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

Update #8

Merged
merged 17 commits into from
Jun 20, 2024
14 changes: 7 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ version = "0.1.0-dev"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LinearOperators = "5c8ed15e-5a4c-59e4-a42b-c7e8811fb125"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
tinatorabi marked this conversation as resolved.
Show resolved Hide resolved
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
QRupdate = "29d2ae51-7246-454b-9a65-19ff7b2849a5"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"


[compat]
julia = "1.9, 1.10"
DataFrames = "1.6"
DataFrames = "1.6"
LinearAlgebra = "1.9, 1.10"
LinearOperators = "2.8"
Printf = "1.9, 1.10"
QRupdate = "1.0"
LinearAlgebra = "1.9, 1.10"
Printf = "1.9, 1.10"
Random = "1.9, 1.10"
SparseArrays = "1.9, 1.10"
Logging = "1.9"
julia = "1.9, 1.10"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
# Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"

[targets]
test = ["Test"]
test = ["Test"]
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,56 @@
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://MPF-Optimization-Laboratory.github.io/ActiveSetPursuit.jl/stable/)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://MPF-Optimization-Laboratory.github.io/ActiveSetPursuit.jl/dev/)
[![Build Status](https://github.com/MPF-Optimization-Laboratory/ActiveSetPursuit.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/MPF-Optimization-Laboratory/ActiveSetPursuit.jl/actions/workflows/CI.yml?query=branch%3Amain)


## ActiveSetPursuit

`ActiveSetPursuit` is a Julia package providing a framework for solving several variations of the sparse optimization problem:

$$\underset{x}{\text{minimize}} \hspace{0.5em} \lambda \||x\||_1 + \frac{1}{2} \||Ax - b\||^2_2$$

### Implemented Algorithms:
- Basis Pursuit Denoising
- Orthogonal Matching Pursuit
- Homotopy Basis Pursuit Denoising

### Installation:

The package can be installed as follows:
```jlcon
julia> ] add ActiveSetPursuit

```



## Example Usage

The `asp_bpdn` function within the `ActiveSetPursuit` package efficiently solves the basis pursuit denoising problem.

Ensure that the following inputs are defined before running the `asp_bpdn` function:
- **`A`**: The matrix or operator, size `m`-by-`n`.
tinatorabi marked this conversation as resolved.
Show resolved Hide resolved
- **`b`**: The vector of observations or measurements, size `m`.
- **`λin`**: A nonnegative scalar that serves as the regularization parameter.

To solve the basis pursuit denoising problem, execute the following command in Julia:

```julia
tinatorabi marked this conversation as resolved.
Show resolved Hide resolved
N, M = 1000, 300
A = randn(N, M)
xref = zeros(M)
xref[randperm(M)[1:20]] = randn(20) # 20 non-zero entries
b = A * xref
const λin = 0.0
tracer = asp_bpdn(A, b, λin)
```
After the optimization process completes, the solution vector and the regularization parameter at any iteration `itn` can be accessed as follows:

```jlcon
xx, λ = tracer[itn]
tinatorabi marked this conversation as resolved.
Show resolved Hide resolved
```
To extract the final iterate:

```jlcon
x_final, λ_final = tracer[itn]
```
9 changes: 5 additions & 4 deletions src/ActiveSetPursuit.jl
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
module ActiveSetPursuit

using LinearAlgebra, SparseArrays, LinearOperators, Printf
using QRupdate
using DataFrames
using LinearAlgebra, SparseArrays, LinearOperators, Printf
using QRupdate, Random
using LinearAlgebra
using Logging

export bpdual, asp_homotopy
export bpdual, asp_homotopy, asp_bpdn, asp_omp

include("BPDual.jl")
include("helpers.jl")
include("homotopy.jl")
include("bpdn.jl")
include("omp.jl")


end
Loading