Skip to content

Commit

Permalink
MNT update readme and use simpler example_config file (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathurinm authored Nov 5, 2024
1 parent d86260d commit 991c541
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 29 deletions.
20 changes: 8 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $$\\boldsymbol{u} \\in \\underset{\\boldsymbol{u} \\in \\mathbb{R}^{n \\times m}
- $\\boldsymbol{y} \\in \\mathbb{R}^{n \\times m}$ is a vector of observations or targets.
- $A \\in \\mathbb{R}^{n \\times n}$ is a design matrix or forward operator.
- $\\lambda > 0$ is a regularization hyperparameter.
- $f(\\boldsymbol{y}, A\\boldsymbol{u}) = \\sum\\limits\_{k=1}^{n} \\sum\\limits\_{l=1}^{m} l(y\_{k,l}, (A\\boldsymbol{u})_{k,l})$ is a loss function, where $l$ can be quadratic loss as $l(y, x) = \\frac{1}{2} \\vert y - x \\vert_2^2$, or Huber loss $l(y, x) = h\_{\\delta} (y - x)$ defined by
- the datafit is $f(\\boldsymbol{y},A\\boldsymbol{u})=\\sum\_{k=1}^{n}\\sum\_{l=1}^{m} l(y\_{k,l}, (A\\boldsymbol{u}))_{k,l}$, where $l$ can either be the quadratic loss $l(y, x) = \\frac{1}{2} \\vert y - x \\vert_2^2$, or the Huber loss $l(y, x) = h\_{\\delta} (y - x)$ defined by


$$
Expand All @@ -37,28 +37,24 @@ g(\\boldsymbol{u}) = \\lambda \\| D_1 \\boldsymbol{u} \\|_{1} + \\| \\boldsymbol
$$


where n (or `height`) and m (or `width`) stand for the dimension of targeted vector.
where n (or `height`) and m (or `width`) are the dimensions of the image.

The type of loss is controlled by the ``data_fit`` attribute of the Objective.

Install
--------

This benchmark can be run using the following commands:
A simple version of this benchmark can be run using the following commands:

.. code-block::
$ pip install -U benchopt
$ git clone https://github.com/benchopt/benchmark_tv_2d
$ benchopt run benchmark_tv_2d
$ cd benchmark_tv_2d
$ benchopt install --config example_config.yml
$ benchopt run --config example_config.yml
Apart from the problem, options can be passed to `benchopt run`, to restrict the benchmarks to some solvers or datasets, e.g.:

.. code-block::
$ benchopt run benchmark_tv_2d --config benchmark_tv_2d/example_config.yml
Use `benchopt run -h` for more details about these options, or visit https://benchopt.github.io/api.html.
To run the benchmark on a limited subset of Objectives, Solvers or Datasets, visit https://benchopt.github.io/api.html or use the command ```benchopt run -h``.

.. |Build Status| image:: https://github.com/benchopt/benchmark_tv_2d/workflows/Tests/badge.svg
:target: https://github.com/benchopt/benchmark_tv_2d/actions
Expand Down
19 changes: 2 additions & 17 deletions example_config.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
objective:
- TV2D[data_fit=lsq,delta=0.0,isotropy=anisotropic,reg=0.02]
- TV2D[data_fit=huber,delta=0.9,isotropy=anisotropic,reg=0.02]
- TV2D[data_fit=lsq,delta=0.0,isotropy=isotropic,reg=0.02]
- TV2D[data_fit=huber,delta=0.9,isotropy=isotropic,reg=0.02]
- TV2D[data_fit=lsq,isotropy=anisotropic,reg=0.5]
dataset:
- Deblurring[size_blur=27,std_blur=2.0,std_noise=0.02,subsampling=4,type_n=gaussian]
- Denoising[std_noise=0.3,subsampling=4,type_n=gaussian]
- Simulated[size_blur=27,std_blur=2.0,std_noise=0.02,subsampling=4,type_A=deblurring,type_n=gaussian]
- Simulated[size_blur=27,std_blur=2.0,std_noise=0.3,subsampling=4,type_A=denoising,type_n=gaussian]
solver:
- ADMM[gamma=0.1]
- Chambolle-Pock PD-split[eta=1.0,ratio=10.0]
- CondatVu[eta=1.0,ratio=1.0]
- Dual PGD analysis[alpha=1.0,ratio=10.0,use_acceleration=True]
- Primal PGD[prox_tv_method=dr,use_acceleration=True]
- Primal PGD[prox_tv_method=pd,use_acceleration=True]
- Primal PGD[prox_tv_method=yang,use_acceleration=True]
- Primal PGD[prox_tv_method=condat,use_acceleration=True]
- Primal PGD[prox_tv_method=chambolle-pock,use_acceleration=True]
- Primal PGD[prox_tv_method=kolmogorov,use_acceleration=True]
# - sporco

n-repetitions: 1
timeout: 200
max-runs: 100
timeout: 5

0 comments on commit 991c541

Please sign in to comment.