Simple quadratic term used to regularise functions. More...
#include <clsfy_logit_loss_function.h>
Public Member Functions | |
clsfy_quad_regulariser (double alpha=1e-6) | |
virtual double | f (vnl_vector< double > const &v) |
The main function: Compute f(v). | |
virtual void | gradf (vnl_vector< double > const &v, vnl_vector< double > &gradient) |
Calculate the gradient of f at parameter vector v. | |
vnl_vector< double > | gradf (vnl_vector< double > const &x) |
virtual void | compute (vnl_vector< double > const &x, double *f, vnl_vector< double > *g) |
int | get_number_of_unknowns () const |
void | fdgradf (vnl_vector< double > const &x, vnl_vector< double > &gradient, double stepsize=1e-5) |
vnl_vector< double > | fdgradf (vnl_vector< double > const &x) |
virtual double | reported_error (double f_value) |
virtual double | get_range_min () const |
virtual double | get_range_max () const |
virtual vnl_unary_function < double, vnl_vector< double > > * | Copy () const |
Public Attributes | |
int | dim |
Protected Member Functions | |
void | set_number_of_unknowns (int number_of_unknowns) |
Private Attributes | |
double | alpha_ |
Scaling factor. |
Simple quadratic term used to regularise functions.
For vector v' = (b w') (ie b=y[0], w=(y[1]...y[n])), computes f(v) = alpha*|w|^2 (ie ignores first element, which is bias of linear classifier)
Definition at line 56 of file clsfy_logit_loss_function.h.
clsfy_quad_regulariser::clsfy_quad_regulariser | ( | double | alpha = 1e-6 | ) |
Definition at line 122 of file clsfy_logit_loss_function.cxx.
double clsfy_quad_regulariser::f | ( | vnl_vector< double > const & | v | ) | [virtual] |
The main function: Compute f(v).
Reimplemented from vnl_cost_function.
Definition at line 128 of file clsfy_logit_loss_function.cxx.
void clsfy_quad_regulariser::gradf | ( | vnl_vector< double > const & | v, |
vnl_vector< double > & | gradient | ||
) | [virtual] |
Calculate the gradient of f at parameter vector v.
Reimplemented from vnl_cost_function.
Definition at line 136 of file clsfy_logit_loss_function.cxx.
double clsfy_quad_regulariser::alpha_ [private] |
Scaling factor.
Definition at line 60 of file clsfy_logit_loss_function.h.