LASSOProblem.h 3.04 KB
Newer Older
1
2
3
4
#pragma once

#include "L1Norm.h"
#include "WLSProblem.h"
5
6
#include "LinearOperator.h"
#include "DataContainer.h"
7
8
9
10

namespace elsa
{
    /**
11
     * @brief Class representing a Least Absolute Shrinkage and Selection Operator problem
12
13
14
     *
     * This class represents a LASSO problem i.e.
     *
15
     *  - @f$ \argmin_x \frac{1}{2} \| Ax - b \|_{W,2}^2 + \lambda \| x \|_1 @f$
16
     *
17
18
     * in which @f$ W @f$ is a weighting (scaling) operator, @f$ A @f$ is a linear operator, @f$
     * b @f$ is a data vector and @f$ \lambda @f$ is the regularization parameter.
19
20
     *
     * References:
21
22
23
24
25
26
27
28
     * - 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
29
30
31
32
33
     */
    template <typename data_t = real_t>
    class LASSOProblem : public Problem<data_t>
    {
    public:
34
35
36
37
38
39
40
41
42
43
        /**
         * @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);

44
        /**
45
         * @brief Constructor for the lasso problem, accepting wlsProblem and regTerm
46
         *
47
48
         * @param[in] wlsProblem WLSProblem
         * @param[in] regTerm RegularizationTerm
49
50
51
52
         */
        LASSOProblem(WLSProblem<data_t> wlsProblem, const RegularizationTerm<data_t>& regTerm);

        /**
53
         * @brief Constructor for converting a general optimization problem to a LASSO one
54
         *
55
         * @param[in] problem the problem to be converted
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
         *
         * Only problems that consist exclusively of a WLSProblem and a L1Norm regularization term
         * can be converted.
         *
         * Acts as a copy constructor if the supplied optimization problem is a LASSO problem.
         */
        explicit LASSOProblem(const Problem<data_t>& problem);

        /// default destructor
        ~LASSOProblem() override = default;

    protected:
        /// implement the polymorphic clone operation
        auto cloneImpl() const -> LASSOProblem<data_t>* override;

        /// the getLipschitzConstant method for the optimization problem
        auto getLipschitzConstantImpl(index_t nIterations) const -> data_t override;

    private:
        WLSProblem<data_t> _wlsProblem;

        /// converts an optimization problem to a WLSProblem
        static auto wlsFromProblem(const Problem<data_t>& problem) -> WLSProblem<data_t>;

        /// converts an optimization problem to a RegularizationTerm
        static auto regTermFromProblem(const Problem<data_t>& problem)
            -> RegularizationTerm<data_t>;
    };
} // namespace elsa