![]() |
SOPT
Sparse OPTimisation
|
Primal Dual Algorithm. More...
#include <primal_dual.h>
Classes | |
struct | Diagnostic |
Values indicating how the algorithm ran. More... | |
struct | DiagnosticAndResult |
Holds result vector as well. More... | |
Public Types | |
using | value_type = SCALAR |
Scalar type. More... | |
using | Scalar = value_type |
Scalar type. More... | |
using | Real = typename real_type< Scalar >::type |
Real type. More... | |
using | t_Vector = Vector< Scalar > |
Type of then underlying vectors. More... | |
using | t_LinearTransform = LinearTransform< t_Vector > |
Type of the Ψ and Ψ^H operations, as well as Φ and Φ^H. More... | |
using | t_IsConverged = std::function< bool(const t_Vector &, const t_Vector &)> |
Type of the convergence function. More... | |
using | t_Constraint = std::function< void(t_Vector &, const t_Vector &)> |
Type of the constraint function. More... | |
using | t_Random_Updater = std::function< bool()> |
Type of random update function. More... | |
using | t_Proximal = ProximalFunction< Scalar > |
Type of the convergence function. More... | |
Public Member Functions | |
template<typename DERIVED > | |
PrimalDual (t_Proximal const &f_proximal, t_Proximal const &g_proximal, Eigen::MatrixBase< DERIVED > const &target) | |
virtual | ~PrimalDual () |
SOPT_MACRO (itermax, t_uint) | |
Maximum number of iterations. More... | |
SOPT_MACRO (update_scale, Real) | |
Update parameter. More... | |
SOPT_MACRO (regulariser_strength, Real) | |
γ parameter. More... | |
SOPT_MACRO (sigma, Real) | |
sigma parameter More... | |
SOPT_MACRO (xi, Real) | |
xi parameter More... | |
SOPT_MACRO (rho, Real) | |
rho parameter More... | |
SOPT_MACRO (tau, Real) | |
tau parameter More... | |
SOPT_MACRO (is_converged, t_IsConverged) | |
A function verifying convergence. More... | |
SOPT_MACRO (constraint, t_Constraint) | |
A function applying a simple constraint. More... | |
SOPT_MACRO (Phi, t_LinearTransform) | |
Measurement operator. More... | |
SOPT_MACRO (Psi, t_LinearTransform) | |
Wavelet operator. More... | |
SOPT_MACRO (f_proximal, t_Proximal) | |
First proximal. More... | |
SOPT_MACRO (g_proximal, t_Proximal) | |
Second proximal. More... | |
SOPT_MACRO (random_measurement_updater, t_Random_Updater) | |
lambda that determines if to update measurements More... | |
SOPT_MACRO (random_wavelet_updater, t_Random_Updater) | |
lambda that determines if to update wavelets More... | |
void | f_proximal (t_Vector &out, Real regulariser_strength, t_Vector const &x) const |
Simplifies calling the proximal of f. More... | |
void | g_proximal (t_Vector &out, Real regulariser_strength, t_Vector const &x) const |
Simplifies calling the proximal of f. More... | |
PrimalDual< Scalar > & | is_converged (std::function< bool(t_Vector const &x)> const &func) |
Convergence function that takes only the output as argument. More... | |
t_Vector const & | target () const |
Vector of target measurements. More... | |
template<typename DERIVED > | |
PrimalDual< Scalar > & | target (Eigen::MatrixBase< DERIVED > const &target) |
Sets the vector of target measurements. More... | |
bool | is_converged (t_Vector const &x, t_Vector const &residual) const |
Facilitates call to user-provided convergence function. More... | |
Diagnostic | operator() (t_Vector &out) const |
Calls Primal Dual. More... | |
Diagnostic | operator() (t_Vector &out, std::tuple< t_Vector, t_Vector > const &guess) const |
Calls Primal Dual. More... | |
Diagnostic | operator() (t_Vector &out, std::tuple< t_Vector const &, t_Vector const & > const &guess) const |
Calls Primal Dual. More... | |
DiagnosticAndResult | operator() (std::tuple< t_Vector, t_Vector > const &guess) const |
Calls Primal Dual. More... | |
DiagnosticAndResult | operator() (std::tuple< t_Vector const &, t_Vector const & > const &guess) const |
Calls Primal Dual. More... | |
DiagnosticAndResult | operator() () const |
Calls Primal Dual. More... | |
DiagnosticAndResult | operator() (DiagnosticAndResult const &warmstart) const |
Makes it simple to chain different calls to PD. More... | |
PrimalDual &::type | Phi (ARGS &&... args) |
PrimalDual &::type | Psi (ARGS &&... args) |
std::tuple< t_Vector, t_Vector > | initial_guess () const |
Computes initial guess for x and the residual using the targets. More... | |
Static Public Member Functions | |
static std::tuple< t_Vector, t_Vector > | initial_guess (t_Vector const &target, t_LinearTransform const &phi) |
Computes initial guess for x and the residual using the targets. More... | |
Primal Dual Algorithm.
\(\min_{x, z} f(x) + h(z)\) subject to \(Φx + z = y\). \(y\) is a target vector.
Definition at line 24 of file primal_dual.h.
using sopt::algorithm::PrimalDual< SCALAR >::Real = typename real_type<Scalar>::type |
Real type.
Definition at line 31 of file primal_dual.h.
using sopt::algorithm::PrimalDual< SCALAR >::Scalar = value_type |
Scalar type.
Definition at line 29 of file primal_dual.h.
using sopt::algorithm::PrimalDual< SCALAR >::t_Constraint = std::function<void (t_Vector &, const t_Vector &)> |
Type of the constraint function.
Definition at line 39 of file primal_dual.h.
using sopt::algorithm::PrimalDual< SCALAR >::t_IsConverged = std::function<bool (const t_Vector &, const t_Vector &)> |
Type of the convergence function.
Definition at line 37 of file primal_dual.h.
using sopt::algorithm::PrimalDual< SCALAR >::t_LinearTransform = LinearTransform<t_Vector> |
Type of the Ψ and Ψ^H operations, as well as Φ and Φ^H.
Definition at line 35 of file primal_dual.h.
using sopt::algorithm::PrimalDual< SCALAR >::t_Proximal = ProximalFunction<Scalar> |
Type of the convergence function.
Definition at line 43 of file primal_dual.h.
using sopt::algorithm::PrimalDual< SCALAR >::t_Random_Updater = std::function<bool ()> |
Type of random update function.
Definition at line 41 of file primal_dual.h.
using sopt::algorithm::PrimalDual< SCALAR >::t_Vector = Vector<Scalar> |
Type of then underlying vectors.
Definition at line 33 of file primal_dual.h.
using sopt::algorithm::PrimalDual< SCALAR >::value_type = SCALAR |
Scalar type.
Definition at line 27 of file primal_dual.h.
|
inline |
Setups PrimalDual
[in] | f_proximal | proximal operator of the \(f\) function. |
[in] | g_proximal | proximal operator of the \(g\) function |
Definition at line 69 of file primal_dual.h.
|
inlinevirtual |
Definition at line 92 of file primal_dual.h.
|
inline |
Simplifies calling the proximal of f.
Definition at line 147 of file primal_dual.h.
|
inline |
Simplifies calling the proximal of f.
Definition at line 151 of file primal_dual.h.
|
inline |
Computes initial guess for x and the residual using the targets.
with y the vector of measurements
Definition at line 233 of file primal_dual.h.
References sopt::algorithm::PrimalDual< SCALAR >::Phi(), and sopt::algorithm::PrimalDual< SCALAR >::target().
Referenced by sopt::algorithm::ImagingPrimalDual< SCALAR >::operator()(), sopt::algorithm::PrimalDual< SCALAR >::operator()(), and sopt::algorithm::TVPrimalDual< SCALAR >::operator()().
|
inlinestatic |
Computes initial guess for x and the residual using the targets.
with y the vector of measurements
This function simplifies creating overloads for operator() in PD wrappers.
Definition at line 243 of file primal_dual.h.
References sopt::LinearTransform< VECTOR >::adjoint(), sopt::LinearTransform< VECTOR >::sq_norm(), and sopt::algorithm::PrimalDual< SCALAR >::target().
|
inline |
Convergence function that takes only the output as argument.
Definition at line 156 of file primal_dual.h.
Referenced by sopt::algorithm::PrimalDual< SCALAR >::is_converged(), and TEST_CASE().
|
inline |
Facilitates call to user-provided convergence function.
Definition at line 170 of file primal_dual.h.
References sopt::algorithm::PrimalDual< SCALAR >::is_converged().
|
inline |
Calls Primal Dual.
[in] | guess | initial guess |
Definition at line 205 of file primal_dual.h.
References sopt::algorithm::PrimalDual< SCALAR >::initial_guess(), and sopt::algorithm::PrimalDual< SCALAR >::DiagnosticAndResult::x.
Referenced by sopt::algorithm::PrimalDual< SCALAR >::operator()().
|
inline |
Makes it simple to chain different calls to PD.
Definition at line 211 of file primal_dual.h.
References sopt::algorithm::PrimalDual< SCALAR >::Diagnostic::residual, and sopt::algorithm::PrimalDual< SCALAR >::DiagnosticAndResult::x.
|
inline |
Calls Primal Dual.
[in] | guess | initial guess |
Definition at line 197 of file primal_dual.h.
References sopt::algorithm::PrimalDual< SCALAR >::DiagnosticAndResult::x.
|
inline |
Calls Primal Dual.
[in] | guess | initial guess |
Definition at line 192 of file primal_dual.h.
References sopt::algorithm::PrimalDual< SCALAR >::operator()().
|
inline |
Calls Primal Dual.
[out] | out | Output vector x |
Definition at line 176 of file primal_dual.h.
References sopt::algorithm::PrimalDual< SCALAR >::initial_guess(), and sopt::algorithm::PrimalDual< SCALAR >::operator()().
Referenced by sopt::algorithm::PrimalDual< SCALAR >::operator()().
|
inline |
Calls Primal Dual.
[out] | out | Output vector x |
[in] | guess | initial guess |
Definition at line 186 of file primal_dual.h.
References sopt::algorithm::PrimalDual< SCALAR >::operator()().
|
inline |
Calls Primal Dual.
[out] | out | Output vector x |
[in] | guess | initial guess |
Definition at line 180 of file primal_dual.h.
References sopt::algorithm::PrimalDual< SCALAR >::operator()().
|
inline |
Definition at line 218 of file primal_dual.h.
References sopt::linear_transform().
Referenced by sopt::algorithm::PrimalDual< SCALAR >::initial_guess().
|
inline |
Definition at line 224 of file primal_dual.h.
References sopt::linear_transform().
sopt::algorithm::PrimalDual< SCALAR >::SOPT_MACRO | ( | constraint | , |
t_Constraint | |||
) |
A function applying a simple constraint.
sopt::algorithm::PrimalDual< SCALAR >::SOPT_MACRO | ( | f_proximal | , |
t_Proximal | |||
) |
First proximal.
sopt::algorithm::PrimalDual< SCALAR >::SOPT_MACRO | ( | g_proximal | , |
t_Proximal | |||
) |
Second proximal.
sopt::algorithm::PrimalDual< SCALAR >::SOPT_MACRO | ( | is_converged | , |
t_IsConverged | |||
) |
A function verifying convergence.
It takes as input two arguments: the current solution x and the current residual.
sopt::algorithm::PrimalDual< SCALAR >::SOPT_MACRO | ( | itermax | , |
t_uint | |||
) |
Maximum number of iterations.
sopt::algorithm::PrimalDual< SCALAR >::SOPT_MACRO | ( | Phi | , |
t_LinearTransform | |||
) |
Measurement operator.
sopt::algorithm::PrimalDual< SCALAR >::SOPT_MACRO | ( | Psi | , |
t_LinearTransform | |||
) |
Wavelet operator.
sopt::algorithm::PrimalDual< SCALAR >::SOPT_MACRO | ( | random_measurement_updater | , |
t_Random_Updater | |||
) |
lambda that determines if to update measurements
sopt::algorithm::PrimalDual< SCALAR >::SOPT_MACRO | ( | random_wavelet_updater | , |
t_Random_Updater | |||
) |
lambda that determines if to update wavelets
sopt::algorithm::PrimalDual< SCALAR >::SOPT_MACRO | ( | regulariser_strength | , |
Real | |||
) |
γ parameter.
sopt::algorithm::PrimalDual< SCALAR >::SOPT_MACRO | ( | rho | , |
Real | |||
) |
rho parameter
sopt::algorithm::PrimalDual< SCALAR >::SOPT_MACRO | ( | sigma | , |
Real | |||
) |
sigma parameter
sopt::algorithm::PrimalDual< SCALAR >::SOPT_MACRO | ( | tau | , |
Real | |||
) |
tau parameter
sopt::algorithm::PrimalDual< SCALAR >::SOPT_MACRO | ( | update_scale | , |
Real | |||
) |
Update parameter.
sopt::algorithm::PrimalDual< SCALAR >::SOPT_MACRO | ( | xi | , |
Real | |||
) |
xi parameter
|
inline |
Vector of target measurements.
Definition at line 161 of file primal_dual.h.
Referenced by sopt::algorithm::PrimalDual< SCALAR >::initial_guess(), and sopt::algorithm::PrimalDual< SCALAR >::target().
|
inline |
Sets the vector of target measurements.
Definition at line 164 of file primal_dual.h.
References sopt::algorithm::PrimalDual< SCALAR >::target().