Commit abc37e77 authored by David Frank's avatar David Frank Committed by Tobias Lasser
Browse files

Add convenience constructor to LASSOProblem

parent acebb9a0
#include "LASSOProblem.h"
#include "LinearOperator.h"
#include "DataContainer.h"
#include "Error.h"
#include "Identity.h"
#include "TypeCasts.hpp"
namespace elsa
{
template <typename data_t>
LASSOProblem<data_t>::LASSOProblem(const LinearOperator<data_t>& A,
const DataContainer<data_t>& b, const real_t lambda)
: LASSOProblem<data_t>(
WLSProblem<data_t>(A, b),
RegularizationTerm<data_t>(lambda, L1Norm<data_t>{A.getDomainDescriptor()}))
{
}
template <typename data_t>
LASSOProblem<data_t>::LASSOProblem(WLSProblem<data_t> wlsProblem,
const RegularizationTerm<data_t>& regTerm)
......
......@@ -2,16 +2,14 @@
#include "L1Norm.h"
#include "WLSProblem.h"
#include "LinearOperator.h"
#include "DataContainer.h"
namespace elsa
{
/**
* @brief Class representing a Least Absolute Shrinkage and Selection Operator problem
*
* @author Andi Braimllari - initial code
*
* @tparam data_t data type for the domain and range of the problem, defaulting to real_t
*
* This class represents a LASSO problem i.e.
*
* - @f$ \argmin_x \frac{1}{2} \| Ax - b \|_{W,2}^2 + \lambda \| x \|_1 @f$
......@@ -20,13 +18,29 @@ namespace elsa
* b @f$ is a data vector and @f$ \lambda @f$ is the regularization parameter.
*
* References:
* https://www.stat.cmu.edu/~ryantibs/papers/lassounique.pdf
* https://arxiv.org/pdf/1501.02888.pdf
* - Ryan J. Tibshirani _The Lasso Problem and Uniqueness_ (2013)
* https://www.stat.cmu.edu/~ryantibs/papers/lassounique.pdf
* - Tao, S., Boley, D., Zhang, S. _Local Linear Convergence of ISTA and FISTA on the LASSO
* Problem_ (2015) https://arxiv.org/pdf/1501.02888.pdf
*
* @author Andi Braimllari - initial code
*
* @tparam data_t data type for the domain and range of the problem, defaulting to real_t
*/
template <typename data_t = real_t>
class LASSOProblem : public Problem<data_t>
{
public:
/**
* @brief Constructor for the lasso problem, construction a WLSProblem
*
* @param[in] A a linear operator
* @param[in] b a data vector
* @param[in] regTerm RegularizationTerm
*/
LASSOProblem(const LinearOperator<data_t>& A, const DataContainer<data_t>& b,
real_t lambda = 0.5f);
/**
* @brief Constructor for the lasso problem, accepting wlsProblem and regTerm
*
......
......@@ -51,10 +51,7 @@ void example2d()
// write the reconstruction out
EDF::write(cgReconstruction, "2dreconstruction_cg.edf");
L1Norm regFunc(projector.getDomainDescriptor());
RegularizationTerm regTerm(0.5f, regFunc);
LASSOProblem lassoProb(wlsProblem, regTerm);
LASSOProblem lassoProb(projector, sinogram);
// solve the reconstruction problem with ISTA
ISTA istaSolver(lassoProb);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment