TOPFeatures.h

Go to the documentation of this file.
00001 /*
00002  * This program is free software; you can redistribute it and/or modify
00003  * it under the terms of the GNU General Public License as published by
00004  * the Free Software Foundation; either version 3 of the License, or
00005  * (at your option) any later version.
00006  *
00007  * Written (W) 1999-2008 Soeren Sonnenburg
00008  * Written (W) 1999-2008 Gunnar Raetsch
00009  * Copyright (C) 1999-2008 Fraunhofer Institute FIRST and Max-Planck-Society
00010  */
00011 
00012 #ifndef _CTOPFEATURES__H__
00013 #define _CTOPFEATURES__H__
00014 
00015 #include "features/RealFeatures.h"
00016 #include "distributions/hmm/HMM.h"
00017 
00019 struct T_HMM_INDIZES
00020 {
00022     INT* idx_p;
00024     INT* idx_q;
00026     INT* idx_a_rows;
00028     INT* idx_a_cols;
00030     INT* idx_b_rows;
00032     INT* idx_b_cols;
00033 
00035     INT num_p;
00037     INT num_q;
00039     INT num_a;
00041     INT num_b;
00042 };
00043 
00045 class CTOPFeatures : public CRealFeatures
00046 {
00047     public:
00056         CTOPFeatures(INT size, CHMM* p, CHMM* n, bool neglin, bool poslin);
00057 
00059         CTOPFeatures(const CTOPFeatures &orig);
00060 
00061         virtual ~CTOPFeatures();
00062 
00068         void set_models(CHMM* p, CHMM* n);
00069 
00074         virtual DREAL* set_feature_matrix();
00075 
00080         INT compute_num_features();
00081 
00088         bool compute_relevant_indizes(CHMM* hmm, T_HMM_INDIZES* hmm_idx);
00089 
00090     protected:
00098         virtual DREAL* compute_feature_vector(INT num, INT& len, DREAL* target=NULL);
00099 
00106         void compute_feature_vector(DREAL* addr, INT num, INT& len);
00107 
00108     protected:
00110         CHMM* pos;
00112         CHMM* neg;
00114         bool neglinear;
00116         bool poslinear;
00117 
00119         T_HMM_INDIZES pos_relevant_indizes;
00121         T_HMM_INDIZES neg_relevant_indizes;
00122 };
00123 #endif

SHOGUN Machine Learning Toolbox - Documentation