#include <cgboost.h>
Inheritance diagram for CGBoost:
Public Member Functions | |
CGBoost (bool cvx=false, const cost::Cost &c=cost::_cost) | |
CGBoost (std::istream &is) | |
virtual const id_t & | id () const |
virtual CGBoost * | create () const |
Create a new object using the default constructor. | |
virtual CGBoost * | clone () const |
Create a new object by replicating itself. | |
virtual bool | set_aggregation_size (UINT) |
Specify the number of hypotheses used in aggregating. | |
virtual void | initialize () |
Initialize the model for training. | |
virtual REAL | train () |
Train with preset data set and sample weight. | |
virtual REAL | train_gd () |
Training using gradient-descent. | |
Protected Member Functions | |
virtual REAL | linear_weight (const DataWgt &, const LearnModel &) |
virtual void | linear_smpwgt (DataWgt &) |
virtual bool | serialize (std::ostream &, ver_list &) const |
virtual bool | unserialize (std::istream &, ver_list &, const id_t &=empty_id) |
Protected Attributes | |
std::vector< REAL > | ncd |
![]() ![]() | |
std::vector< REAL > | cgd |
![]() ![]() | |
std::vector< REAL > | cur_err |
data only valid within training (remove?) | |
Friends | |
struct | _boost_cg |
This class provides two ways to implement the conjugate gradient idea in the Boosting frame.
The first way is to manipulate the sample weight.
The other way is to adjust the projected search direction f. The adjusted direction is also a linear combination of weak learners. We prefer this way (by use_gradient_descent(true)
).
Differences between AdaBoost and CGBoost (gradient descent view):
Definition at line 36 of file cgboost.h.
|
Definition at line 46 of file cgboost.h. Referenced by CGBoost::clone(), and CGBoost::create(). |
|
|
|
Create a new object by replicating itself.
return new Derived(*this);
Reimplemented from Boosting. Definition at line 52 of file cgboost.h. References CGBoost::CGBoost(). |
|
Create a new object using the default constructor. The code for a derived class Derived is always return new Derived(); Reimplemented from Boosting. Definition at line 51 of file cgboost.h. References CGBoost::CGBoost(). |
|
Reimplemented from Boosting. |
|
Initialize the model for training.
Reimplemented from Boosting. Definition at line 21 of file cgboost.cpp. References Boosting::initialize(). |
|
ncd is actually
It can be iteratively computed as
Reimplemented from Boosting. Definition at line 143 of file cgboost.cpp. References CGBoost::cur_err, EPSILON, Boosting::get_output(), Boosting::lm_wgt, Aggregating::n_in_agg, LearnModel::n_samples, CGBoost::ncd, LearnModel::ptd, and LearnModel::ptw. |
|
Reimplemented from Boosting. Definition at line 111 of file cgboost.cpp. References LearnModel::c_error(), CGBoost::cur_err, LearnModel::get_output(), LearnModel::n_output(), LearnModel::n_samples, CGBoost::ncd, and LearnModel::ptd. |
|
Reimplemented from Boosting. Definition at line 38 of file cgboost.cpp. References Boosting::grad_desc_view, SERIALIZE_PARENT, and Aggregating::size(). |
|
Specify the number of hypotheses used in aggregating.
Reimplemented from Aggregating. Definition at line 26 of file cgboost.cpp. References Boosting::clear_cache(), Boosting::grad_desc_view, Boosting::lm_wgt, Aggregating::set_aggregation_size(), and Aggregating::size(). |
|
Train with preset data set and sample weight.
Reimplemented from Boosting. Definition at line 83 of file cgboost.cpp. References CGBoost::cgd, CGBoost::cur_err, Boosting::grad_desc_view, LearnModel::n_output(), LearnModel::n_samples, CGBoost::ncd, LearnModel::ptw, Boosting::train(), and CGBoost::train_gd(). |
|
Training using gradient-descent.
Reimplemented from Boosting. Definition at line 99 of file cgboost.cpp. References Boosting::convex, Boosting::cost(), and lemga::iterative_optimize(). Referenced by CGBoost::train(). |
|
Reimplemented from Boosting. Definition at line 56 of file cgboost.cpp. References Object::empty_id, Boosting::lm_wgt, Aggregating::size(), UNSERIALIZE_PARENT, and Boosting::use_gradient_descent(). |
|
|
|
Definition at line 42 of file cgboost.h. Referenced by CGBoost::train(). |
|
data only valid within training (remove?)
Definition at line 61 of file cgboost.h. Referenced by CGBoost::linear_smpwgt(), CGBoost::linear_weight(), and CGBoost::train(). |
|
Definition at line 42 of file cgboost.h. Referenced by CGBoost::linear_smpwgt(), CGBoost::linear_weight(), and CGBoost::train(). |