SOPT
Sparse OPTimisation
Classes | Public Types | Public Member Functions | List of all members
sopt::algorithm::ImagingProximalADMM< SCALAR > Class Template Reference

#include <imaging_padmm.h>

Classes

struct  Diagnostic
 Values indicating how the algorithm ran. More...
 
struct  DiagnosticAndResult
 Holds result vector as well. More...
 

Public Types

using value_type = typename PADMM::value_type
 
using Scalar = typename PADMM::Scalar
 
using Real = typename PADMM::Real
 
using t_Vector = typename PADMM::t_Vector
 
using t_LinearTransform = typename PADMM::t_LinearTransform
 
using t_Proximal = typename PADMM::t_Proximal
 
using t_IsConverged = typename PADMM::t_IsConverged
 

Public Member Functions

template<typename DERIVED >
 ImagingProximalADMM (Eigen::MatrixBase< DERIVED > const &target)
 
virtual ~ImagingProximalADMM ()
 
proximal::L1< Scalar > * g_proximal ()
 
 SOPT_MACRO (l1_proximal, proximal::L1< Scalar >)
 Maximum number of iterations. More...
 
 SOPT_MACRO (l2ball_proximal, proximal::WeightedL2Ball< Scalar >)
 The weighted L2 proximal functioning as g. More...
 
 SOPT_MACRO (tight_frame, bool)
 Whether Ψ is a tight-frame or not. More...
 
 SOPT_MACRO (residual_tolerance, Real)
 Convergence of the relative variation of the objective functions. More...
 
 SOPT_MACRO (relative_variation, Real)
 Convergence of the relative variation of the objective functions. More...
 
 SOPT_MACRO (residual_convergence, t_IsConverged)
 Convergence of the residuals. More...
 
 SOPT_MACRO (objective_convergence, t_IsConverged)
 Convergence of the residuals. More...
 
 SOPT_MACRO (itermax, t_uint)
 Maximum number of iterations. More...
 
 SOPT_MACRO (regulariser_strength, Real)
 γ parameter. More...
 
 SOPT_MACRO (lagrange_update_scale, Real)
 Lagrange update scale β More...
 
 SOPT_MACRO (is_converged, t_IsConverged)
 A function verifying convergence. More...
 
 SOPT_MACRO (Phi, t_LinearTransform)
 Measurement operator. More...
 
t_Vector const & target () const
 Vector of target measurements. More...
 
template<typename DERIVED >
ImagingProximalADMM< Scalar > & target (Eigen::MatrixBase< DERIVED > const &target)
 Sets the vector of target measurements. More...
 
Diagnostic operator() (t_Vector &out) const
 Calls Proximal ADMM. More...
 
Diagnostic operator() (t_Vector &out, std::tuple< t_Vector, t_Vector > const &guess) const
 Calls Proximal ADMM. More...
 
Diagnostic operator() (t_Vector &out, std::tuple< t_Vector const &, t_Vector const & > const &guess) const
 Calls Proximal ADMM. More...
 
DiagnosticAndResult operator() (std::tuple< t_Vector, t_Vector > const &guess) const
 Calls Proximal ADMM. More...
 
DiagnosticAndResult operator() (std::tuple< t_Vector const &, t_Vector const & > const &guess) const
 Calls Proximal ADMM. More...
 
DiagnosticAndResult operator() () const
 Calls Proximal ADMM. More...
 
DiagnosticAndResult operator() (DiagnosticAndResult const &warmstart) const
 Makes it simple to chain different calls to PADMM. More...
 
ImagingProximalADMM &::type Phi (ARGS &&... args)
 
proximal::L1< Scalar > & l1_proximal ()
 L1 proximal used during calculation. More...
 
proximal::WeightedL2Ball< Scalar > & l2ball_proximal ()
 Proximal of the L2 ball. More...
 
t_LinearTransform const & Psi () const
 Analysis operator Ψ More...
 
ImagingProximalADMM< Scalar > &::type Psi (ARGS &&... args)
 
 SOPT_MACRO (itermax, l1, L1)
 
 SOPT_MACRO (tolerance, l1, L1)
 
 SOPT_MACRO (positivity_constraint, l1, L1)
 
 SOPT_MACRO (real_constraint, l1, L1)
 
 SOPT_MACRO (fista_mixing, l1, L1)
 
 SOPT_MACRO (nu, l1, L1)
 
 SOPT_MACRO (weights, l1, L1)
 
 SOPT_MACRO (epsilon, l2ball, WeightedL2Ball)
 
 SOPT_MACRO (weights, l2ball, WeightedL2Ball)
 
ImagingProximalADMM< Scalar > & residual_convergence (Real const &tolerance)
 Helper function to set-up default residual convergence function. More...
 
ImagingProximalADMM< Scalar > & objective_convergence (Real const &tolerance)
 Helper function to set-up default residual convergence function. More...
 
ImagingProximalADMM< Scalar > & is_converged (std::function< bool(t_Vector const &x)> const &func)
 Convergence function that takes only the output as argument. More...
 

Detailed Description

template<typename SCALAR>
class sopt::algorithm::ImagingProximalADMM< SCALAR >

Definition at line 20 of file imaging_padmm.h.

Member Typedef Documentation

◆ Real

template<typename SCALAR >
using sopt::algorithm::ImagingProximalADMM< SCALAR >::Real = typename PADMM::Real

Definition at line 27 of file imaging_padmm.h.

◆ Scalar

template<typename SCALAR >
using sopt::algorithm::ImagingProximalADMM< SCALAR >::Scalar = typename PADMM::Scalar

Definition at line 26 of file imaging_padmm.h.

◆ t_IsConverged

template<typename SCALAR >
using sopt::algorithm::ImagingProximalADMM< SCALAR >::t_IsConverged = typename PADMM::t_IsConverged

Definition at line 31 of file imaging_padmm.h.

◆ t_LinearTransform

template<typename SCALAR >
using sopt::algorithm::ImagingProximalADMM< SCALAR >::t_LinearTransform = typename PADMM::t_LinearTransform

Definition at line 29 of file imaging_padmm.h.

◆ t_Proximal

template<typename SCALAR >
using sopt::algorithm::ImagingProximalADMM< SCALAR >::t_Proximal = typename PADMM::t_Proximal

Definition at line 30 of file imaging_padmm.h.

◆ t_Vector

template<typename SCALAR >
using sopt::algorithm::ImagingProximalADMM< SCALAR >::t_Vector = typename PADMM::t_Vector

Definition at line 28 of file imaging_padmm.h.

◆ value_type

template<typename SCALAR >
using sopt::algorithm::ImagingProximalADMM< SCALAR >::value_type = typename PADMM::value_type

Definition at line 25 of file imaging_padmm.h.

Constructor & Destructor Documentation

◆ ImagingProximalADMM()

template<typename SCALAR >
template<typename DERIVED >
sopt::algorithm::ImagingProximalADMM< SCALAR >::ImagingProximalADMM ( Eigen::MatrixBase< DERIVED > const &  target)
inline

Setups imaging wrapper for ProximalADMM

Parameters
[in]f_proximalproximal operator of the \(f\) function.
[in]g_proximalproximal operator of the \(g\) function

Definition at line 55 of file imaging_padmm.h.

56  : l1_proximal_(),
57  l2ball_proximal_(1e0),
58  tight_frame_(false),
59  residual_tolerance_(1e-4),
60  relative_variation_(1e-4),
61  residual_convergence_(nullptr),
62  objective_convergence_(nullptr),
63  itermax_(std::numeric_limits<t_uint>::max()),
64  regulariser_strength_(1e-8),
65  lagrange_update_scale_(0.9),
66  is_converged_(),
67  Phi_(linear_transform_identity<Scalar>()),
68  target_(target) {}
t_Vector const & target() const
Vector of target measurements.

◆ ~ImagingProximalADMM()

template<typename SCALAR >
virtual sopt::algorithm::ImagingProximalADMM< SCALAR >::~ImagingProximalADMM ( )
inlinevirtual

Definition at line 69 of file imaging_padmm.h.

69 {}

Member Function Documentation

◆ g_proximal()

template<typename SCALAR >
proximal::L1<Scalar>* sopt::algorithm::ImagingProximalADMM< SCALAR >::g_proximal ( )
inline

Definition at line 85 of file imaging_padmm.h.

86  {
87  return &l1_proximal_;
88  }

◆ is_converged()

template<typename SCALAR >
ImagingProximalADMM<Scalar>& sopt::algorithm::ImagingProximalADMM< SCALAR >::is_converged ( std::function< bool(t_Vector const &x)> const &  func)
inline

Convergence function that takes only the output as argument.

Definition at line 241 of file imaging_padmm.h.

241  {
242  return is_converged([func](t_Vector const &x, t_Vector const &) { return func(x); });
243  }
sopt::Vector< Scalar > t_Vector
ImagingProximalADMM< Scalar > & is_converged(std::function< bool(t_Vector const &x)> const &func)
Convergence function that takes only the output as argument.

Referenced by TEST_CASE().

◆ l1_proximal()

template<typename SCALAR >
proximal::L1<Scalar>& sopt::algorithm::ImagingProximalADMM< SCALAR >::l1_proximal ( )
inline

L1 proximal used during calculation.

Non-const version to setup the object.

Definition at line 184 of file imaging_padmm.h.

184 { return l1_proximal_; }

Referenced by sopt::algorithm::ImagingProximalADMM< SCALAR >::Psi().

◆ l2ball_proximal()

template<typename SCALAR >
proximal::WeightedL2Ball<Scalar>& sopt::algorithm::ImagingProximalADMM< SCALAR >::l2ball_proximal ( )
inline

Proximal of the L2 ball.

Non-const version to setup the object.

Definition at line 187 of file imaging_padmm.h.

187 { return l2ball_proximal_; }

Referenced by TEST_CASE().

◆ objective_convergence()

template<typename SCALAR >
ImagingProximalADMM<Scalar>& sopt::algorithm::ImagingProximalADMM< SCALAR >::objective_convergence ( Real const &  tolerance)
inline

Helper function to set-up default residual convergence function.

Definition at line 237 of file imaging_padmm.h.

237  {
238  return objective_convergence(nullptr).relative_variation(tolerance);
239  }
ImagingProximalADMM< Scalar > & objective_convergence(Real const &tolerance)
Helper function to set-up default residual convergence function.

◆ operator()() [1/7]

template<typename SCALAR >
DiagnosticAndResult sopt::algorithm::ImagingProximalADMM< SCALAR >::operator() ( ) const
inline

Calls Proximal ADMM.

Parameters
[in]guessinitial guess

Definition at line 162 of file imaging_padmm.h.

162  {
163  DiagnosticAndResult result;
164  static_cast<Diagnostic &>(result) = operator()(result.x,
166  return result;
167  }
ImagingProximalADMM &::type Phi(ARGS &&... args)
std::tuple< t_Vector, t_Vector > initial_guess() const
Computes initial guess for x and the residual using the targets.
Definition: padmm.h:183

References sopt::algorithm::ProximalADMM< SCALAR >::initial_guess(), sopt::algorithm::ImagingProximalADMM< SCALAR >::Phi(), sopt::algorithm::ImagingProximalADMM< SCALAR >::target(), and sopt::algorithm::ImagingProximalADMM< SCALAR >::DiagnosticAndResult::x.

Referenced by sopt::algorithm::ImagingProximalADMM< SCALAR >::operator()().

◆ operator()() [2/7]

template<typename SCALAR >
DiagnosticAndResult sopt::algorithm::ImagingProximalADMM< SCALAR >::operator() ( DiagnosticAndResult const &  warmstart) const
inline

Makes it simple to chain different calls to PADMM.

Definition at line 169 of file imaging_padmm.h.

169  {
170  DiagnosticAndResult result = warmstart;
171  static_cast<Diagnostic &>(result) = operator()(result.x, warmstart.x, warmstart.residual);
172  return result;
173  }

References sopt::algorithm::ProximalADMM< SCALAR >::Diagnostic::residual, and sopt::algorithm::ImagingProximalADMM< SCALAR >::DiagnosticAndResult::x.

◆ operator()() [3/7]

template<typename SCALAR >
DiagnosticAndResult sopt::algorithm::ImagingProximalADMM< SCALAR >::operator() ( std::tuple< t_Vector const &, t_Vector const & > const &  guess) const
inline

Calls Proximal ADMM.

Parameters
[in]guessinitial guess

Definition at line 154 of file imaging_padmm.h.

155  {
156  DiagnosticAndResult result;
157  static_cast<Diagnostic &>(result) = operator()(result.x, guess);
158  return result;
159  }

References sopt::algorithm::ImagingProximalADMM< SCALAR >::DiagnosticAndResult::x.

◆ operator()() [4/7]

template<typename SCALAR >
DiagnosticAndResult sopt::algorithm::ImagingProximalADMM< SCALAR >::operator() ( std::tuple< t_Vector, t_Vector > const &  guess) const
inline

Calls Proximal ADMM.

Parameters
[in]guessinitial guess

Definition at line 149 of file imaging_padmm.h.

149  {
150  return operator()(std::tie(std::get<0>(guess), std::get<1>(guess)));
151  }
DiagnosticAndResult operator()() const
Calls Proximal ADMM.

References sopt::algorithm::ImagingProximalADMM< SCALAR >::operator()().

◆ operator()() [5/7]

template<typename SCALAR >
Diagnostic sopt::algorithm::ImagingProximalADMM< SCALAR >::operator() ( t_Vector out) const
inline

◆ operator()() [6/7]

template<typename SCALAR >
Diagnostic sopt::algorithm::ImagingProximalADMM< SCALAR >::operator() ( t_Vector out,
std::tuple< t_Vector const &, t_Vector const & > const &  guess 
) const
inline

Calls Proximal ADMM.

Parameters
[out]outOutput vector x
[in]guessinitial guess

Definition at line 143 of file imaging_padmm.h.

144  {
145  return operator()(out, std::get<0>(guess), std::get<1>(guess));
146  }

References sopt::algorithm::ImagingProximalADMM< SCALAR >::operator()().

◆ operator()() [7/7]

template<typename SCALAR >
Diagnostic sopt::algorithm::ImagingProximalADMM< SCALAR >::operator() ( t_Vector out,
std::tuple< t_Vector, t_Vector > const &  guess 
) const
inline

Calls Proximal ADMM.

Parameters
[out]outOutput vector x
[in]guessinitial guess

Definition at line 137 of file imaging_padmm.h.

137  {
138  return operator()(out, std::get<0>(guess), std::get<1>(guess));
139  }

References sopt::algorithm::ImagingProximalADMM< SCALAR >::operator()().

◆ Phi()

template<typename SCALAR >
ImagingProximalADMM& ::type sopt::algorithm::ImagingProximalADMM< SCALAR >::Phi ( ARGS &&...  args)
inline

Definition at line 177 of file imaging_padmm.h.

177  {
178  Phi_ = linear_transform(std::forward<ARGS>(args)...);
179  return *this;
180  }
LinearTransform< VECTOR > linear_transform(OperatorFunction< VECTOR > const &direct, OperatorFunction< VECTOR > const &indirect, std::array< t_int, 3 > const &sizes={{1, 1, 0}})

References sopt::linear_transform().

Referenced by sopt::algorithm::ImagingProximalADMM< SCALAR >::operator()(), and TEST_CASE().

◆ Psi() [1/2]

template<typename SCALAR >
t_LinearTransform const& sopt::algorithm::ImagingProximalADMM< SCALAR >::Psi ( ) const
inline

Analysis operator Ψ

Under-the-hood, the object is actually owned by the L1 proximal.

Definition at line 191 of file imaging_padmm.h.

191 { return l1_proximal().Psi(); }
proximal::L1< Scalar > & l1_proximal()
L1 proximal used during calculation.
LinearTransform< Vector< Scalar > > const & Psi() const
Linear transform applied to input prior to L1 norm.
Definition: l1_proximal.h:302

References sopt::algorithm::ImagingProximalADMM< SCALAR >::l1_proximal(), and sopt::proximal::L1< SCALAR >::Psi().

Referenced by TEST_CASE().

◆ Psi() [2/2]

template<typename SCALAR >
ImagingProximalADMM<Scalar>& ::type sopt::algorithm::ImagingProximalADMM< SCALAR >::Psi ( ARGS &&...  args)
inline

Definition at line 194 of file imaging_padmm.h.

195  {
196  l1_proximal().Psi(std::forward<ARGS>(args)...);
197  return *this;
198  }

References sopt::algorithm::ImagingProximalADMM< SCALAR >::l1_proximal(), and sopt::proximal::L1< SCALAR >::Psi().

◆ residual_convergence()

template<typename SCALAR >
ImagingProximalADMM<Scalar>& sopt::algorithm::ImagingProximalADMM< SCALAR >::residual_convergence ( Real const &  tolerance)
inline

Helper function to set-up default residual convergence function.

Definition at line 233 of file imaging_padmm.h.

233  {
234  return residual_convergence(nullptr).residual_tolerance(tolerance);
235  }
ImagingProximalADMM< Scalar > & residual_convergence(Real const &tolerance)
Helper function to set-up default residual convergence function.

Referenced by main(), and TEST_CASE().

◆ SOPT_MACRO() [1/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( epsilon  ,
l2ball  ,
WeightedL2Ball   
)

◆ SOPT_MACRO() [2/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( fista_mixing  ,
l1  ,
L1   
)

◆ SOPT_MACRO() [3/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( is_converged  ,
t_IsConverged   
)

A function verifying convergence.

◆ SOPT_MACRO() [4/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( itermax  ,
l1  ,
L1   
)

◆ SOPT_MACRO() [5/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( itermax  ,
t_uint   
)

Maximum number of iterations.

◆ SOPT_MACRO() [6/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( l1_proximal  ,
proximal::L1< Scalar  
)

Maximum number of iterations.

◆ SOPT_MACRO() [7/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( l2ball_proximal  ,
proximal::WeightedL2Ball< Scalar  
)

The weighted L2 proximal functioning as g.

◆ SOPT_MACRO() [8/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( lagrange_update_scale  ,
Real   
)

Lagrange update scale β

◆ SOPT_MACRO() [9/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( nu  ,
l1  ,
L1   
)

◆ SOPT_MACRO() [10/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( objective_convergence  ,
t_IsConverged   
)

Convergence of the residuals.

If negative, this convergence criteria is disabled.

◆ SOPT_MACRO() [11/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( Phi  ,
t_LinearTransform   
)

Measurement operator.

◆ SOPT_MACRO() [12/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( positivity_constraint  ,
l1  ,
L1   
)

◆ SOPT_MACRO() [13/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( real_constraint  ,
l1  ,
L1   
)

◆ SOPT_MACRO() [14/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( regulariser_strength  ,
Real   
)

γ parameter.

◆ SOPT_MACRO() [15/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( relative_variation  ,
Real   
)

Convergence of the relative variation of the objective functions.

If negative, this convergence criteria is disabled.

◆ SOPT_MACRO() [16/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( residual_convergence  ,
t_IsConverged   
)

Convergence of the residuals.

If negative, this convergence criteria is disabled.

◆ SOPT_MACRO() [17/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( residual_tolerance  ,
Real   
)

Convergence of the relative variation of the objective functions.

If negative, this convergence criteria is disabled.

◆ SOPT_MACRO() [18/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( tight_frame  ,
bool   
)

Whether Ψ is a tight-frame or not.

◆ SOPT_MACRO() [19/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( tolerance  ,
l1  ,
L1   
)

◆ SOPT_MACRO() [20/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( weights  ,
l1  ,
L1   
)

◆ SOPT_MACRO() [21/21]

template<typename SCALAR >
sopt::algorithm::ImagingProximalADMM< SCALAR >::SOPT_MACRO ( weights  ,
l2ball  ,
WeightedL2Ball   
)

◆ target() [1/2]

template<typename SCALAR >
t_Vector const& sopt::algorithm::ImagingProximalADMM< SCALAR >::target ( ) const
inline

Vector of target measurements.

Definition at line 121 of file imaging_padmm.h.

121 { return target_; }

Referenced by sopt::algorithm::ImagingProximalADMM< SCALAR >::operator()(), sopt::algorithm::ImagingProximalADMM< SCALAR >::target(), and TEST_CASE().

◆ target() [2/2]

template<typename SCALAR >
template<typename DERIVED >
ImagingProximalADMM<Scalar>& sopt::algorithm::ImagingProximalADMM< SCALAR >::target ( Eigen::MatrixBase< DERIVED > const &  target)
inline

Sets the vector of target measurements.

Definition at line 124 of file imaging_padmm.h.

124  {
125  target_ = target;
126  return *this;
127  }

References sopt::algorithm::ImagingProximalADMM< SCALAR >::target().


The documentation for this class was generated from the following file: