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

#include <ebl_answer.h>

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

List of all members.

Public Member Functions

 answer_module (uint nfeatures, const char *name="answer_module")
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 bprop (labeled_datasource< T, Tds1, Tds2 > &ds, Tstate &out)
virtual void bbprop (labeled_datasource< T, Tds1, Tds2 > &ds, Tstate &out)
virtual void fprop (labeled_datasource< T, Tds1, Tds2 > &ds, mstate< Tstate > &out)
 Produce target matrix into 'out' for training, given a datasource 'ds'.
virtual void bprop (labeled_datasource< T, Tds1, Tds2 > &ds, mstate< Tstate > &out)
virtual void bbprop (labeled_datasource< T, Tds1, Tds2 > &ds, mstate< Tstate > &out)
virtual bool correct (Tstate &answer, Tstate &label)
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 void forget (forget_param_linear &fp)
 forgetting weights by replacing with random values
virtual std::string describe ()
 Returns a string describing this module and its parameters.
virtual uint get_nfeatures ()
 Returns the number of features expected as inputs.

Protected Attributes

uint nfeatures
 Number of input features.

Detailed Description

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

A generic class describing a module that can be put on top of a network and transform its output into answers, such as class and confidence. It can also be used to produce target inputs for training given a datasource object.


Member Function Documentation

template<typename T, typename Tds1, typename Tds2, class Tstate>
void ebl::answer_module< T, Tds1, Tds2, Tstate >::bbprop ( labeled_datasource< T, Tds1, Tds2 > &  ds,
Tstate &  out 
) [virtual]

Back-propagates 2nd derivatives. This might be useful if answer module has learnable internal parameters.

template<typename T, typename Tds1, typename Tds2, class Tstate>
void ebl::answer_module< T, Tds1, Tds2, Tstate >::bbprop ( labeled_datasource< T, Tds1, Tds2 > &  ds,
mstate< Tstate > &  out 
) [virtual]

Back-propagates 2nd derivatives. This might be useful if answer module has learnable internal parameters.

template<typename T, typename Tds1, typename Tds2, class Tstate>
void ebl::answer_module< T, Tds1, Tds2, Tstate >::bprop ( labeled_datasource< T, Tds1, Tds2 > &  ds,
Tstate &  out 
) [virtual]

Back-propagates gradients. This might be useful if answer module has learnable internal parameters.

template<typename T, typename Tds1, typename Tds2, class Tstate>
void ebl::answer_module< T, Tds1, Tds2, Tstate >::bprop ( labeled_datasource< T, Tds1, Tds2 > &  ds,
mstate< Tstate > &  out 
) [virtual]

Back-propagates gradients. This might be useful if answer module has learnable internal parameters.

template<typename T , typename Tds1 , typename Tds2 , class Tstate>
bool ebl::answer_module< T, Tds1, Tds2, Tstate >::correct ( Tstate &  answer,
Tstate &  label 
) [virtual]

Returns true if 'answer' matches with 'label'.

Reimplemented in ebl::class_answer< T, Tds1, Tds2, Tstate >, and ebl::regression_answer< T, Tds1, Tds2, Tstate >.

template<typename T , typename Tds1 , typename Tds2 , class Tstate>
void ebl::answer_module< T, Tds1, Tds2, Tstate >::fprop ( Tstate &  in,
Tstate &  out 
) [virtual]

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