ebl::supervised_trainer< Tdata, Tlabel > Class Template Reference

#include <EblTrainer.h>

List of all members.

Public Member Functions

 supervised_trainer (fc_ebm2< state_idx, int, state_idx > &m, parameter &p, ostream &cout=std::cout)
void set_display (unsigned int nh, unsigned int nw, unsigned int h0=0, unsigned int w0=0, double zoom=1.0, int wid=-1, const char *title=NULL)
int run (state_idx &input, infer_param &infp)
bool test_sample (state_idx &input, int label, int &answer, infer_param &infp)
Idx< double > learn_sample (state_idx &input, int label, gd_param &arg)
void test (LabeledDataSource< Tdata, Tlabel > &ds, classifier_meter &log, infer_param &infp, bool display=false)
void train (LabeledDataSource< Tdata, Tlabel > &ds, classifier_meter &log, gd_param &args, int niter)
void compute_diaghessian (LabeledDataSource< Tdata, Tlabel > &ds, intg niter, double mu)
 compute hessian
void resize_input (LabeledDataSource< Tdata, Tlabel > &ds)

Public Attributes

fc_ebm2< state_idx, int,
state_idx > & 
machine
parameterparam
state_idxinput
state_idx energy
Idx< Tlabel > label
intg age
ostream & cout


Detailed Description

template<class Tdata, class Tlabel>
class ebl::supervised_trainer< Tdata, Tlabel >

Generic Trainer Supervised Trainer

Member Function Documentation

template<class Tdata, class Tlabel>
int ebl::supervised_trainer< Tdata, Tlabel >::run ( state_idx input,
infer_param &  infp 
) [inline]

take an input and a vector of possible labels (each of which is a vector, hence <label-set> is a matrix) and return the index of the label that minimizes the energy fill up the vector <energies> with the energy produced by each possible label. The first dimension of <label-set> must be equal to the dimension of <energies>.

template<class Tdata, class Tlabel>
bool ebl::supervised_trainer< Tdata, Tlabel >::test_sample ( state_idx input,
int  label,
int &  answer,
infer_param &  infp 
) [inline]

Test a single sample and its label <label> (an integer). Returns true if the sample was correctly classified, false otherwise.

template<class Tdata, class Tlabel>
Idx< double > ebl::supervised_trainer< Tdata, Tlabel >::learn_sample ( state_idx input,
int  label,
gd_param arg 
) [inline]

perform a learning update on one sample. <sample> is the input sample, <label> is the desired category (an integer), <label-set> is a matrix where the i-th row is the desired output for the i-th category, and <update-args> is a list of arguments for the parameter update method (e.g. learning rate and weight decay).

template<class Tdata, class Tlabel>
void ebl::supervised_trainer< Tdata, Tlabel >::test ( LabeledDataSource< Tdata, Tlabel > &  ds,
classifier_meter log,
infer_param &  infp,
bool  display = false 
) [inline]

Measure the average energy and classification error rate on a dataset. returns a list with average loss and proportion of errors

template<class Tdata, class Tlabel>
void ebl::supervised_trainer< Tdata, Tlabel >::train ( LabeledDataSource< Tdata, Tlabel > &  ds,
classifier_meter log,
gd_param args,
int  niter 
) [inline]

train for <niter> sweeps over the training set. <samples> contains the inputs samples, and <labels> the corresponding desired categories <labels>. return the average energy computed on-the-fly. <update-args> is a list of arguments for the parameter update method (e.g. learning rate and weight decay).

template<class Tdata, class Tlabel>
void ebl::supervised_trainer< Tdata, Tlabel >::resize_input ( LabeledDataSource< Tdata, Tlabel > &  ds  )  [inline]

Resize <input> based on the datasource. If <input> is not allocated, allocate it. TODO: If order or dimensions have changed, reallocate.


The documentation for this class was generated from the following files:

Generated on Mon Mar 30 18:15:26 2009 for libeblearn by  doxygen 1.5.6