The cost function, sum Geman-McClure error functions over all training examples. More...
Public Member Functions | |
gmrho_sum (const vnl_matrix< double > &x, const vnl_vector< double > &y, double sigma=1) | |
construct passing in reference to data matrix. | |
void | set_sigma (double sigma) |
reset the scaling factor. | |
virtual double | f (vnl_vector< double > const &w) |
The main function. Given the vector of weights parameters vector , compute the value of f(x). | |
virtual void | gradf (vnl_vector< double > const &x, vnl_vector< double > &gradient) |
Calculate the gradient of f at parameter vector x. | |
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 | |
const vnl_matrix< double > & | x_ |
Reference to data matrix, one row per training example. | |
const vnl_vector< double > & | y_ |
Reference to required outputs. | |
double | sigma_ |
Scale factor used in Geman-McClure error function. | |
double | var_ |
sigma squared. | |
unsigned | num_examples_ |
Number of training examples (x_.rows()). | |
unsigned | num_vars_ |
Number of dimensions (x_.cols()). | |
double | alpha_ |
var_/(1+var_)^2 - ensures continuity of derivative at hyperplane boundary. | |
double | beta_ |
1/(1+var_)^2 - with alpha, ensures continuity of function at hyperplane boundary. |
The cost function, sum Geman-McClure error functions over all training examples.
Definition at line 27 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
clsfy_binary_hyperplane_gmrho_builder_helpers::gmrho_sum::gmrho_sum | ( | const vnl_matrix< double > & | x, |
const vnl_vector< double > & | y, | ||
double | sigma = 1 |
||
) |
construct passing in reference to data matrix.
The error function class.
This returns a geman-mcclure robust function if the point is correctly classified Otherwise the squared error is returned, with coefficient and offset to ensure continuity and smoothness at the join
Definition at line 331 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
double clsfy_binary_hyperplane_gmrho_builder_helpers::gmrho_sum::f | ( | vnl_vector< double > const & | w | ) | [virtual] |
The main function. Given the vector of weights parameters vector , compute the value of f(x).
Return the error sum function.
Reimplemented from vnl_cost_function.
Definition at line 352 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
void clsfy_binary_hyperplane_gmrho_builder_helpers::gmrho_sum::gradf | ( | vnl_vector< double > const & | x, |
vnl_vector< double > & | gradient | ||
) | [virtual] |
Calculate the gradient of f at parameter vector x.
Calculate gradient of the error sum function.
Reimplemented from vnl_cost_function.
Definition at line 381 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
void clsfy_binary_hyperplane_gmrho_builder_helpers::gmrho_sum::set_sigma | ( | double | sigma | ) |
reset the scaling factor.
Definition at line 340 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
double clsfy_binary_hyperplane_gmrho_builder_helpers::gmrho_sum::alpha_ [private] |
var_/(1+var_)^2 - ensures continuity of derivative at hyperplane boundary.
Definition at line 42 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
double clsfy_binary_hyperplane_gmrho_builder_helpers::gmrho_sum::beta_ [private] |
1/(1+var_)^2 - with alpha, ensures continuity of function at hyperplane boundary.
Definition at line 44 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
unsigned clsfy_binary_hyperplane_gmrho_builder_helpers::gmrho_sum::num_examples_ [private] |
Number of training examples (x_.rows()).
Definition at line 38 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
unsigned clsfy_binary_hyperplane_gmrho_builder_helpers::gmrho_sum::num_vars_ [private] |
Number of dimensions (x_.cols()).
Definition at line 40 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
double clsfy_binary_hyperplane_gmrho_builder_helpers::gmrho_sum::sigma_ [private] |
Scale factor used in Geman-McClure error function.
Definition at line 34 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
double clsfy_binary_hyperplane_gmrho_builder_helpers::gmrho_sum::var_ [private] |
sigma squared.
Definition at line 36 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
const vnl_matrix<double>& clsfy_binary_hyperplane_gmrho_builder_helpers::gmrho_sum::x_ [private] |
Reference to data matrix, one row per training example.
Definition at line 30 of file clsfy_binary_hyperplane_gmrho_builder.cxx.
const vnl_vector<double>& clsfy_binary_hyperplane_gmrho_builder_helpers::gmrho_sum::y_ [private] |
Reference to required outputs.
Definition at line 32 of file clsfy_binary_hyperplane_gmrho_builder.cxx.