libeblearn
|
#include <ebl_answer.h>
Public Member Functions | |
scalerclass_answer (uint nclasses, double target_factor=1.0, bool binary_target=false, t_confidence conf=confidence_max, bool apply_tanh=false, uint jsize=3, uint joffset=0, float mgauss=1.5, bool predict_conf=false, bool predict_bconf=false, idx< T > *biases=NULL, idx< T > *coeffs=NULL, const char *name="scalerclass_answer") | |
virtual void | fprop (Tstate &in, Tstate &out) |
virtual void | fprop (labeled_datasource< T, Tds1, Tds2 > &ds, Tstate &out) |
Produce target matrix into 'out' for training, given a datasource 'ds'. | |
virtual void | update_log (classifier_meter &log, intg age, idx< T > &energy, idx< T > &answer, idx< T > &label, idx< T > &target, idx< T > &rawout) |
Update the 'log' according to this type of answer module. | |
virtual std::string | describe () |
Returns a string describing this module and its parameters. | |
Protected Attributes | |
bbstate_idx< T > | jitter |
A temp buffer to extract jitter info to. | |
Tstate | out_class |
Temporary class buffer. | |
Tstate | tmp1 |
Temporary buffer. | |
Tstate | tmp2 |
Temporary buffer. | |
uint | jsize |
Number of jitter elements used. | |
uint | joffset |
Offset in jitter elements. | |
float | scale_mgauss |
Mean of scale confidence gaussian. | |
bool | predict_conf |
Predict confidence. | |
bool | predict_bconf |
Predicted confidence is binary or not. | |
uint | pconf_offset |
Offset of predicted confidence feature. | |
std::vector< std::string > | log_fields |
Names of variables to log. | |
idx< T > * | biases |
Normalization biases: scale,h,w,conf. | |
idx< T > * | coeffs |
Normalization coeffs: scale,h,w,conf. |
This module gathers information from a labeled_datasource 'ds' and outputs a state of type 'Tstate'. The output state is a 1-of-n target vector given the discret label of the sample concatenated with an additional scale element.
ebl::scalerclass_answer< T, Tds1, Tds2, Tstate >::scalerclass_answer | ( | uint | nclasses, |
double | target_factor = 1.0 , |
||
bool | binary_target = false , |
||
t_confidence | conf = confidence_max , |
||
bool | apply_tanh = false , |
||
uint | jsize = 3 , |
||
uint | joffset = 0 , |
||
float | mgauss = 1.5 , |
||
bool | predict_conf = false , |
||
bool | predict_bconf = false , |
||
idx< T > * | biases = NULL , |
||
idx< T > * | coeffs = NULL , |
||
const char * | name = "scalerclass_answer< T, Tds1, Tds2, Tstate >" |
||
) |
Initialize target vectors given the number of classes.
nclasses | The number of classes for classification. |
target_factor | A factor applied to targets. |
binary_target | If true, target is a scalar with -1 or 1. |
conf | The type of confidence. |
apply_tanh | If true, a tanh is applied to inputs (targets only, not scale input). |
jsize | The number of jitter elements to use. |
joffset | The offset to start using jitters. |
predict_conf | Add an extra feature for confidence prediction. |
predict_bconf | If true, predicted confidence is binary (0,1). |
void ebl::scalerclass_answer< T, Tds1, Tds2, Tstate >::fprop | ( | Tstate & | in, |
Tstate & | out | ||
) | [virtual] |
Produce a vector of answers given input 'in'. 'out' contains answers in this order: class id and confidence.
Reimplemented from ebl::class_answer< T, Tds1, Tds2, Tstate >.