Changeset 37 for trunk/src/SVM.h
- Timestamp:
- Feb 13, 2004, 4:46:31 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SVM.h
r36 r37 8 8 #include "vector.h" 9 9 #include "matrix.h" 10 10 11 11 12 // Standard C++ includes … … 34 35 */ 35 36 inline thep_gsl_api::vector get_alpha() const; 37 38 /** 39 Function will return the output from SVM 40 */ 41 inline thep_gsl_api::vector get_output() const; 42 36 43 37 44 … … 41 48 thep_gsl_api::vector target_; 42 49 thep_gsl_api::vector alpha_; 50 double bias_; 43 51 44 52 /** 45 Private function that determines when to stop the training 53 Private function that determines when to stop the training. 54 The test is done in two steps. First, we check that the 55 functional margin is at least 2 - epsilon. Second, we check 56 that the gap between the primal and the dual object is less 57 than epsilon. 58 46 59 */ 47 60 bool SVM::stop(const thep_gsl_api::vector& target_, … … 55 68 return alpha_; 56 69 } 70 71 thep_gsl_api::vector SVM::get_output() const 72 { 73 thep_gsl_api::vector bias(target_.size(), false, false); 74 bias.set_all(bias_); 75 return kernel_ * alpha_.mul_elements(target_) + bias; 76 77 } 57 78 }; // namespace thep_c++_tools 58 79
Note: See TracChangeset
for help on using the changeset viewer.