Changeset 706 for trunk/yat/classifier
- Timestamp:
- Dec 19, 2006, 9:59:19 AM (17 years ago)
- Location:
- trunk/yat/classifier
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/classifier/SVM.cc
r680 r706 149 149 } 150 150 151 void SVM::reset(void) 152 { 153 trained_=false; 154 alpha_=utility::vector(target_.size(), 0); 155 } 156 151 157 bool SVM::train(void) 152 158 { -
trunk/yat/classifier/SVM.h
r692 r706 92 92 /// @returns mean of vector \f$ C_i \f$ 93 93 /// 94 inline double C(void) const { return 1 /C_inverse_; }94 inline double C(void) const { return 1.0/C_inverse_; } 95 95 96 96 /// … … 139 139 140 140 /// 141 /// Function sets \f$ \alpha=0 \f$ and makes SVM untrained. 142 /// 143 inline void reset(void) 144 { trained_=false; alpha_=utility::vector(target_.size(),0); } 141 /// @brief Function sets \f$ \alpha=0 \f$ and makes SVM untrained. 142 /// 143 void reset(void); 145 144 146 145 /// -
trunk/yat/classifier/SVindex.h
r680 r706 50 50 51 51 // @return index_first 52 inline size_t index_first(void) const 53 { assert(index_first_<size()); return index_first_; } 52 inline size_t index_first(void) const { return index_first_; } 54 53 55 54 // @return index_second 56 inline size_t index_second(void) const 57 { assert(index_second_<size()); return index_second_; } 55 inline size_t index_second(void) const { return index_second_; } 58 56 59 57 // synch the object against alpha … … 89 87 90 88 // @return value_first 91 inline size_t value_first(void) const 92 { assert(value_first_<size()); return value_first_; } 89 inline size_t value_first(void) const { return value_first_; } 93 90 94 91 // @return const ref value_second 95 inline size_t value_second(void) const 96 { assert(value_first_<size()); return value_second_; } 92 inline size_t value_second(void) const { return value_second_; } 97 93 98 inline size_t operator()(size_t i) const { 99 assert(i<size()); assert(vec_[i]<size()); return vec_[i]; } 94 inline size_t operator()(size_t i) const { return vec_[i]; } 100 95 101 96 private: -
trunk/yat/classifier/Target.h
r680 r706 91 91 92 92 /// 93 /// Default binary is set to false for all classes except class 0. 93 /// @brief Default binary is set to false for all classes except 94 /// class 0. 94 95 /// 95 96 /// @return binary target for sample @a i … … 97 98 /// @see set_binary 98 99 /// 99 inline bool binary(const size_t i) const 100 { assert(i<size()); return binary_[operator()(i)]; } 100 inline bool binary(const size_t i) const { return binary_[operator()(i)]; } 101 101 102 102 /// … … 110 110 /// 0 which is set to true. 111 111 /// 112 inline void set_binary(const size_t i, const bool b) 113 { assert(i<nof_classes()); binary_[i]=b; } 112 inline void set_binary(const size_t i, const bool b) { binary_[i]=b; } 114 113 115 114 /// … … 141 140 /// 142 141 inline size_t operator()(const size_t sample) const 143 { assert(sample<size());return classes_[sample]; }142 { return classes_[sample]; } 144 143 145 144 ///
Note: See TracChangeset
for help on using the changeset viewer.