The class FKFeatures implements Fischer kernel features obtained from two Hidden Markov models.
It was used in
K. Tsuda, M. Kawanabe, G. Raetsch, S. Sonnenburg, and K.R. Mueller. A new discriminative kernel from probabilistic models. Neural Computation, 14:2397-2414, 2002.
which also has the details.
Note that FK-features are computed on the fly, so to be effective feature caching should be enabled.
It inherits its functionality from CSimpleFeatures, which should be consulted for further reference.
Definition at line 35 of file FKFeatures.h.
Public Member Functions | |
CFKFeatures (int32_t size, CHMM *p, CHMM *n) | |
CFKFeatures (const CFKFeatures &orig) | |
virtual | ~CFKFeatures () |
void | set_models (CHMM *p, CHMM *n) |
void | set_a (float64_t a) |
float64_t | get_a () |
virtual float64_t * | set_feature_matrix () |
float64_t | set_opt_a (float64_t a=-1) |
float64_t | get_weight_a () |
virtual const char * | get_name () const |
Protected Member Functions | |
virtual float64_t * | compute_feature_vector (int32_t num, int32_t &len, float64_t *target=NULL) |
void | compute_feature_vector (float64_t *addr, int32_t num, int32_t &len) |
float64_t | deriv_a (float64_t a, int32_t dimension=-1) |
Protected Attributes | |
CHMM * | pos |
CHMM * | neg |
float64_t * | pos_prob |
float64_t * | neg_prob |
float64_t | weight_a |
constructor
size | cache size | |
p | positive HMM | |
n | negative HMM |
Definition at line 16 of file FKFeatures.cpp.
CFKFeatures::CFKFeatures | ( | const CFKFeatures & | orig | ) |
copy constructor
Definition at line 25 of file FKFeatures.cpp.
CFKFeatures::~CFKFeatures | ( | ) | [virtual] |
Definition at line 30 of file FKFeatures.cpp.
void CFKFeatures::compute_feature_vector | ( | float64_t * | addr, | |
int32_t | num, | |||
int32_t & | len | |||
) | [protected] |
computes the feature vector to the address addr
addr | address | |
num | num | |
len | len |
Definition at line 161 of file FKFeatures.cpp.
float64_t * CFKFeatures::compute_feature_vector | ( | int32_t | num, | |
int32_t & | len, | |||
float64_t * | target = NULL | |||
) | [protected, virtual] |
compute feature vector
num | num | |
len | len | |
target |
Reimplemented from CSimpleFeatures< float64_t >.
Definition at line 141 of file FKFeatures.cpp.
float64_t CFKFeatures::get_a | ( | ) |
virtual const char* CFKFeatures::get_name | ( | ) | const [virtual] |
Reimplemented from CSimpleFeatures< float64_t >.
Definition at line 96 of file FKFeatures.h.
float64_t CFKFeatures::get_weight_a | ( | ) |
void CFKFeatures::set_a | ( | float64_t | a | ) |
float64_t * CFKFeatures::set_feature_matrix | ( | ) | [virtual] |
CHMM* CFKFeatures::neg [protected] |
negative HMM
Definition at line 128 of file FKFeatures.h.
float64_t* CFKFeatures::neg_prob [protected] |
negative prob
Definition at line 132 of file FKFeatures.h.
CHMM* CFKFeatures::pos [protected] |
positive HMM
Definition at line 126 of file FKFeatures.h.
float64_t* CFKFeatures::pos_prob [protected] |
positive prob
Definition at line 130 of file FKFeatures.h.
float64_t CFKFeatures::weight_a [protected] |
weight a
Definition at line 134 of file FKFeatures.h.