The class TOPFeatures implements TOP 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 TOP-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 68 of file TOPFeatures.h.
Public Member Functions | |
CTOPFeatures (int32_t size, CHMM *p, CHMM *n, bool neglin, bool poslin) | |
CTOPFeatures (const CTOPFeatures &orig) | |
virtual | ~CTOPFeatures () |
void | set_models (CHMM *p, CHMM *n) |
virtual float64_t * | set_feature_matrix () |
int32_t | compute_num_features () |
bool | compute_relevant_indizes (CHMM *hmm, T_HMM_INDIZES *hmm_idx) |
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) |
Protected Attributes | |
CHMM * | pos |
CHMM * | neg |
bool | neglinear |
bool | poslinear |
T_HMM_INDIZES | pos_relevant_indizes |
T_HMM_INDIZES | neg_relevant_indizes |
CTOPFeatures | ( | int32_t | size, | |
CHMM * | p, | |||
CHMM * | n, | |||
bool | neglin, | |||
bool | poslin | |||
) |
constructor
size | cache size | |
p | positive HMM | |
n | negative HMM | |
neglin | if negative HMM is of linear shape | |
poslin | if positive HMM is of linear shape |
Definition at line 18 of file TOPFeatures.cpp.
CTOPFeatures | ( | const CTOPFeatures & | orig | ) |
copy constructor
Definition at line 27 of file TOPFeatures.cpp.
~CTOPFeatures | ( | ) | [virtual] |
Definition at line 33 of file TOPFeatures.cpp.
void 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 93 of file TOPFeatures.cpp.
float64_t * 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 77 of file TOPFeatures.cpp.
int32_t compute_num_features | ( | ) |
compute number of features
Definition at line 324 of file TOPFeatures.cpp.
bool compute_relevant_indizes | ( | CHMM * | hmm, | |
T_HMM_INDIZES * | hmm_idx | |||
) |
compute relevant indices
hmm | HMM to compute for | |
hmm_idx | HMM index |
Definition at line 221 of file TOPFeatures.cpp.
virtual const char* get_name | ( | ) | const [virtual] |
Reimplemented from CSimpleFeatures< float64_t >.
Definition at line 114 of file TOPFeatures.h.
float64_t * set_feature_matrix | ( | ) | [virtual] |
negative HMM
Definition at line 139 of file TOPFeatures.h.
T_HMM_INDIZES neg_relevant_indizes [protected] |
negative relevant indices
Definition at line 148 of file TOPFeatures.h.
bool neglinear [protected] |
if negative HMM is a LinearHMM
Definition at line 141 of file TOPFeatures.h.
positive HMM
Definition at line 137 of file TOPFeatures.h.
T_HMM_INDIZES pos_relevant_indizes [protected] |
positive relevant indices
Definition at line 146 of file TOPFeatures.h.
bool poslinear [protected] |
if positive HMM is a LinearHMM
Definition at line 143 of file TOPFeatures.h.