libeblearn
|
#include <datasource.h>
Public Member Functions | |
labeled_datasource () | |
CAUTION: This empty constructor requires a subsequent call to init(). | |
labeled_datasource (midx< Tdata > &data, idx< Tlabel > &labels, const char *name=NULL) | |
labeled_datasource (idx< Tdata > &data, idx< Tlabel > &labels, const char *name=NULL) | |
labeled_datasource (const char *root_ds, const char *name=NULL) | |
labeled_datasource (const char *root, const char *data_name, const char *labels_name, const char *jitters_name=NULL, const char *scales_name=NULL, const char *name=NULL) | |
virtual | ~labeled_datasource () |
Destructor. | |
void | init (midx< Tdata > &data, idx< Tlabel > &labels, const char *name) |
Initialize from matrices, where data is a multi-matrix. | |
void | init (idx< Tdata > &data, idx< Tlabel > &labels, const char *name) |
Initialize from matrices. | |
void | init (const char *data_fname, const char *labels_fname, const char *jitters_fname=NULL, const char *name=NULL, const char *scales_fname=NULL, uint max_size=0) |
void | init_root (const char *root, const char *data_fname, const char *labels_fname, const char *jitters_fname=NULL, const char *scales_fname=NULL, const char *name=NULL) |
Intialize from root and partial matrices filenames. | |
void | init_root (const char *root_dsname, const char *name=NULL) |
virtual void | fprop (bbstate_idx< Tnet > &out, bbstate_idx< Tlabel > &label) |
virtual void | fprop_label (fstate_idx< Tlabel > &s) |
Copy current sample's label into s. | |
virtual void | fprop_label_net (fstate_idx< Tnet > &s) |
virtual void | fprop_label_net (bbstate_idx< Tnet > &s) |
virtual void | fprop_jitter (bbstate_idx< Tnet > &s) |
Copy current sample's jitter into s. | |
virtual intg | fprop_scale () |
Returns a scale id for this sample. | |
virtual bool | included_sample (intg index) |
This returns true if sample with 'index' is considered for training. | |
virtual intg | count_included_samples () |
This returns the number of samples actually considered for training. | |
virtual void | pretty () |
Print info about the datasource on the standard output. | |
virtual void | pretty_scales () |
Print info about the scales data on the standard output. | |
virtual idxdim | label_dims () |
Returns the dimensions of a single label. | |
virtual void | set_label_bias (Tnet bias) |
Set the bias to add to the labels (before multiplying by coeff). | |
virtual void | set_label_coeff (Tnet coeff) |
Set the coefficient to multiply the labels with (after adding bias). | |
virtual bool | has_scales () |
Returns true if this dataset contains scale information. | |
Protected Member Functions | |
void | init_labels (idx< Tlabel > &labels, const char *name) |
Initialize labels. This should only be called by init(). | |
Protected Attributes | |
Tnet | label_bias |
Tnet | label_coeff |
idx< Tlabel > | labels |
idx< intg > | scales |
midx< float > | jitters |
Jitter information. | |
bool | scales_loaded |
Scales info was loaded or not. | |
idxdim | jitters_maxdim |
Maximum dimensions in jitters matrices. | |
idxdim | labeldims |
Dimensions of a label. | |
Friends | |
class | labeled_datasource_gui |
class | supervised_trainer |
class | supervised_trainer_gui |
labeled_datasource A datasource associating samples with their corresponding label. A label is not necessarly a discrete class label, it can be continuous values in a regression setting. For discrete classification purpose, use 'class_datasource'.
ebl::labeled_datasource< Tnet, Tdata, Tlabel >::labeled_datasource | ( | midx< Tdata > & | data, |
idx< Tlabel > & | labels, | ||
const char * | name = NULL |
||
) |
Construct a datasource associating 'data' and its 'labels' where data is a multi-matrix matrix (midx type). This allows for dynamic loading of data and avoids the need to fit all data in memory.
name | An optional name for this dataset. |
ebl::labeled_datasource< Tnet, Tdata, Tlabel >::labeled_datasource | ( | idx< Tdata > & | data, |
idx< Tlabel > & | labels, | ||
const char * | name = NULL |
||
) |
Construct a datasource associating 'data' and its 'labels'.
name | An optional name for this dataset. |
ebl::labeled_datasource< Tnet, Tdata, Tlabel >::labeled_datasource | ( | const char * | root_ds, |
const char * | name = NULL |
||
) |
Constructor from the full general name (i.e. root/dataset) but without the individual file names such as "_data.mat". This appends names and extension of each subfile of a dataset created with the dscompile tool.
name | An optional name for this dataset. |
ebl::labeled_datasource< Tnet, Tdata, Tlabel >::labeled_datasource | ( | const char * | root, |
const char * | data_name, | ||
const char * | labels_name, | ||
const char * | jitters_name = NULL , |
||
const char * | scales_name = NULL , |
||
const char * | name = NULL |
||
) |
Constructor from data root and names for data, labels and classes files (appending names and extension of each subfile of a dataset created with the dscompile tool).
name | An optional name for this dataset. |
void ebl::labeled_datasource< Tnet, Tdata, Tlabel >::fprop | ( | bbstate_idx< Tnet > & | out, |
bbstate_idx< Tlabel > & | label | ||
) | [virtual] |
get the current item and copy the sample into <out> (an idx3-state) and the corresponding label into <lbl> (and idx0 of int).
void ebl::labeled_datasource< Tnet, Tdata, Tlabel >::fprop_label_net | ( | bbstate_idx< Tnet > & | s | ) | [virtual] |
Copy current sample's label into s (name has to be different than fprop_label in case Tnet == Tlabel).
Reimplemented in ebl::hierarchy_datasource< Tnet, Tdata, Tlabel >.
void ebl::labeled_datasource< Tnet, Tdata, Tlabel >::fprop_label_net | ( | fstate_idx< Tnet > & | s | ) | [virtual] |
Copy current sample's label into s (name has to be different than fprop_label in case Tnet == Tlabel).
Reimplemented in ebl::hierarchy_datasource< Tnet, Tdata, Tlabel >.
void ebl::labeled_datasource< Tnet, Tdata, Tlabel >::init | ( | const char * | data_fname, |
const char * | labels_fname, | ||
const char * | jitters_fname = NULL , |
||
const char * | name = NULL , |
||
const char * | scales_fname = NULL , |
||
uint | max_size = 0 |
||
) |
Intialize from matrices filenames.
max_size | If > 0, limit the number of samples to this value. |
void ebl::labeled_datasource< Tnet, Tdata, Tlabel >::init_root | ( | const char * | root_dsname, |
const char * | name = NULL |
||
) |
Initialize from data root and names for data, labels and classes files (appending names and extension of each subfile of a dataset created with the dscompile tool).
Reimplemented in ebl::class_datasource< Tnet, Tdata, Tlabel >.