#include <clsfy_smo_base.h>
Inheritance diagram for clsfy_smo_base:

This finds the optimal point on a quadratic function constrained by inequality bounds on each parameter, and a single equality constraint. The is the class of problems associated with Support Vector Machines
Definition at line 24 of file clsfy_smo_base.h.
Public Member Functions | |
| const vnl_vector< double > & | lagrange_mults () const |
| Get the optimised parameters. | |
| void | set_lagrange_mults (const vnl_vector< double > &lagrange_mults) |
| Set the initial values of the parameters to be optimised. | |
| double | bias () |
| Bias term in function evaluation. | |
| virtual void | reseed (unsigned long seed) |
| Reseeds the internal random number generator. | |
| const double & | tolerance () const |
| amount by which a sample can violate the KKT conditions. | |
| void | set_tolerance (double tolerance) |
| Set the amount by which a sample can violate the KKT conditions. | |
| double | eps () const |
| tolerance on several equalities. | |
| void | set_eps (double eps) |
| Set the tolerance on several equalities. | |
| clsfy_smo_base () | |
| virtual | ~clsfy_smo_base () |
| virtual double | error_rate () |
| virtual int | calc ()=0 |
| Run the optimisation. | |
| double | error () |
| error rate on the training data. | |
Protected Member Functions | |
| virtual int | take_step (int i1, int i2, double E1)=0 |
| Attempt to jointly optimise Lagrange multipliers i1, and i2. | |
| virtual int | examine_example (int i1)=0 |
| Attempt to optimise sample i1. | |
| const vnl_vector< double > & | data_point (unsigned long l) |
| Access the data points. | |
| virtual double | kernel (int i1, int i2)=0 |
| Calculate the kernel for data items i1 and i2;. | |
| virtual double | learned_func (int k) |
| Calculate the classifier function learnt so far for data item k. | |
Protected Attributes | |
| double | error_ |
| Error rate on the training data. | |
| mbl_data_wrapper< vnl_vector< double > > * | data_ |
| An iterator on the data;. | |
| vnl_vector< double > | alph_ |
| The parameters to be optimised. | |
| double | tolerance_ |
| Amount by which a sample can violate the KKT conditions. | |
| double | eps_ |
| Tolerance on several equalities. | |
| double | b_ |
| Bias. | |
| vcl_vector< double > | error_cache_ |
| Cache KKT error values for unbound multipliers. | |
| vcl_vector< int > | target_ |
| Target values y_i. | |
| vcl_vector< double > | precomputed_self_dot_product_ |
| The norm of each training vector is useful to know quickly. | |
| vnl_random | rng_ |
|
|
Definition at line 127 of file clsfy_smo_base.cxx. |
|
|
Definition at line 134 of file clsfy_smo_base.cxx. |
|
|
Bias term in function evaluation. For SVMs this would be the value to be subtracted from sum of kernel functions to get 0 as class boundary. Definition at line 68 of file clsfy_smo_base.cxx. |
|
|
Run the optimisation.
Implemented in clsfy_smo_1_lin, and clsfy_smo_1_rbf. |
|
|
Access the data points.
Definition at line 29 of file clsfy_smo_base.cxx. |
|
|
tolerance on several equalities. Including testing if a Lagrange multiplier is at one of the bounds. Definition at line 109 of file clsfy_smo_base.cxx. |
|
|
error rate on the training data.
Definition at line 21 of file clsfy_smo_base.cxx. |
|
|
Definition at line 141 of file clsfy_smo_base.cxx. |
|
|
Attempt to optimise sample i1. This attempts to find another value i2, in order to jointly optimise both. Implemented in clsfy_smo_1_lin. |
|
||||||||||||
|
Calculate the kernel for data items i1 and i2;.
Implemented in clsfy_smo_1_lin, and clsfy_smo_1_rbf. |
|
|
Get the optimised parameters.
Definition at line 51 of file clsfy_smo_base.cxx. |
|
|
Calculate the classifier function learnt so far for data item k.
Definition at line 37 of file clsfy_smo_base.cxx. |
|
|
Reseeds the internal random number generator. To achieve quasi-random initialisation use; #include <vcl_ctime.h>
..
sampler.reseed(vcl_time(0));
Definition at line 82 of file clsfy_smo_base.cxx. |
|
|
Set the tolerance on several equalities. Including testing if a Lagrange multiplier is at one of the bounds. Default value is 0.001 Definition at line 119 of file clsfy_smo_base.cxx. |
|
|
Set the initial values of the parameters to be optimised. The caller is responsible for ensuring that the initial values fulfill the constraints; Definition at line 61 of file clsfy_smo_base.cxx. |
|
|
Set the amount by which a sample can violate the KKT conditions. Default value is 0.001 Definition at line 99 of file clsfy_smo_base.cxx. |
|
||||||||||||||||
|
Attempt to jointly optimise Lagrange multipliers i1, and i2.
Implemented in clsfy_smo_1_lin. |
|
|
amount by which a sample can violate the KKT conditions.
Definition at line 90 of file clsfy_smo_base.cxx. |
|
|
The parameters to be optimised.
Definition at line 35 of file clsfy_smo_base.h. |
|
|
Bias.
Definition at line 46 of file clsfy_smo_base.h. |
|
|
An iterator on the data;.
Definition at line 32 of file clsfy_smo_base.h. |
|
|
Tolerance on several equalities. Including testing if a Lagrange multiplier is at one of the bounds. Definition at line 42 of file clsfy_smo_base.h. |
|
|
Error rate on the training data.
Definition at line 29 of file clsfy_smo_base.h. |
|
|
Cache KKT error values for unbound multipliers.
Definition at line 50 of file clsfy_smo_base.h. |
|
|
The norm of each training vector is useful to know quickly.
Definition at line 56 of file clsfy_smo_base.h. |
|
|
Definition at line 58 of file clsfy_smo_base.h. |
|
|
Target values y_i.
Definition at line 53 of file clsfy_smo_base.h. |
|
|
Amount by which a sample can violate the KKT conditions.
Definition at line 38 of file clsfy_smo_base.h. |
1.4.4