libeblearn
ebl::scalerclass_answer< T, Tds1, Tds2, Tstate > Class Template Reference

#include <ebl_answer.h>

Inheritance diagram for ebl::scalerclass_answer< T, Tds1, Tds2, Tstate >:
ebl::class_answer< T, Tds1, Tds2, Tstate > ebl::answer_module< T, Tds1, Tds2, Tstate > ebl::module_1_1< T, Tstate > ebl::module

List of all members.

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.

Detailed Description

template<typename T, typename Tds1 = T, typename Tds2 = T, class Tstate = bbstate_idx<T>>
class ebl::scalerclass_answer< T, Tds1, Tds2, Tstate >

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.


Constructor & Destructor Documentation

template<typename T , typename Tds1 , typename Tds2 , class Tstate >
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.

Parameters:
nclassesThe number of classes for classification.
target_factorA factor applied to targets.
binary_targetIf true, target is a scalar with -1 or 1.
confThe type of confidence.
apply_tanhIf true, a tanh is applied to inputs (targets only, not scale input).
jsizeThe number of jitter elements to use.
joffsetThe offset to start using jitters.
predict_confAdd an extra feature for confidence prediction.
predict_bconfIf true, predicted confidence is binary (0,1).

Member Function Documentation

template<typename T , typename Tds1 , typename Tds2 , class Tstate >
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 >.


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