SOPT
Sparse OPTimisation
Public Member Functions | List of all members
sopt::L2DifferentiableFunc< SCALAR > Class Template Reference

#include <l2_differentiable_func.h>

+ Inheritance diagram for sopt::L2DifferentiableFunc< SCALAR >:
+ Collaboration diagram for sopt::L2DifferentiableFunc< SCALAR >:

Public Member Functions

 L2DifferentiableFunc (const Real sigma, const LinearTransform &Phi)
 
void log_message () const override
 
void gradient (Vector &output, const Vector &image, const Vector &residual, const LinearTransform &Phi) override
 
Real function (Vector const &image, Vector const &y, LinearTransform const &Phi) override
 
- Public Member Functions inherited from DifferentiableFunc< SCALAR >
virtual t_Gradient gradient ()
 
Real get_step_size () const
 

Additional Inherited Members

- Public Types inherited from DifferentiableFunc< SCALAR >
using FB = sopt::algorithm::ForwardBackward< SCALAR >
 
using Real = typename FB::Real
 
using t_Vector = typename FB::t_Vector
 
using t_Gradient = typename FB::t_Gradient
 
using t_LinearTransform = typename FB::t_LinearTransform
 

Detailed Description

template<typename SCALAR>
class sopt::L2DifferentiableFunc< SCALAR >

Definition at line 11 of file l2_differentiable_func.h.

Constructor & Destructor Documentation

◆ L2DifferentiableFunc()

template<typename SCALAR >
sopt::L2DifferentiableFunc< SCALAR >::L2DifferentiableFunc ( const Real  sigma,
const LinearTransform &  Phi 
)
inline

Definition at line 19 of file l2_differentiable_func.h.

20  : LT(Phi), sigma(sigma)
21  {
22  this->step_size = 0.98*sigma*sigma;
23  }

References sopt::sigma().

Member Function Documentation

◆ function()

template<typename SCALAR >
Real sopt::L2DifferentiableFunc< SCALAR >::function ( Vector const &  image,
Vector const &  y,
LinearTransform const &  Phi 
)
inlineoverridevirtual

Implements DifferentiableFunc< SCALAR >.

Definition at line 36 of file l2_differentiable_func.h.

37  {
38  // Does this need to be modified to take into account MPI?
39  Real Likelihood = 0.5 * ((Phi*image) - y).squaredNorm() / (sigma * sigma);
40  return Likelihood;
41  }

◆ gradient()

template<typename SCALAR >
void sopt::L2DifferentiableFunc< SCALAR >::gradient ( Vector &  output,
const Vector &  image,
const Vector &  residual,
const LinearTransform &  Phi 
)
inlineoverridevirtual

Implements DifferentiableFunc< SCALAR >.

Definition at line 30 of file l2_differentiable_func.h.

32  {
33  output = Phi.adjoint() * (residual / (sigma * sigma)); // L2 norm
34  }
LinearTransform< VECTOR > adjoint() const
Indirect transform.

◆ log_message()

template<typename SCALAR >
void sopt::L2DifferentiableFunc< SCALAR >::log_message ( ) const
inlineoverridevirtual

Implements DifferentiableFunc< SCALAR >.

Definition at line 25 of file l2_differentiable_func.h.

26  {
27  SOPT_HIGH_LOG("Using L2 differentiable function f(x)");
28  }
#define SOPT_HIGH_LOG(...)
High priority message.
Definition: logging.h:223

References SOPT_HIGH_LOG.


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