SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PositionalPWM.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2011 Soeren Sonnenburg
8  * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society
9  */
10 
11 #ifndef _POSITIONAL_PWM_H__
12 #define _POSITIONAL_PWM_H__
13 
16 #include <shogun/lib/common.h>
18 
19 namespace shogun
20 {
23 {
24  public:
27 
28  virtual ~CPositionalPWM();
29 
36  virtual bool train(CFeatures* data=NULL);
37 
42  virtual int32_t get_num_model_parameters();
43 
49  virtual float64_t get_log_model_parameter(int32_t num_param);
50 
58  int32_t num_param, int32_t num_example);
59 
67  virtual float64_t get_log_likelihood_example(int32_t num_example);
68 
74  float64_t get_log_likelihood_window(uint8_t* window, int32_t len, float64_t pos);
75 
78  virtual inline float64_t get_sigma()
79  {
80  return m_sigma;
81  }
82 
87  virtual inline void set_sigma(float64_t sigma)
88  {
89  m_sigma=sigma;
90  }
91 
94  virtual inline float64_t get_mean()
95  {
96  return m_mean;
97  }
98 
103  virtual inline void set_mean(float64_t mean)
104  {
105  m_mean=mean;
106  }
107 
112  virtual inline void set_pwm(SGMatrix<float64_t> pwm)
113  {
114  m_pwm=pwm.matrix;
115  m_pwm_rows=pwm.num_rows;
116  m_pwm_cols=pwm.num_cols;
117  }
118 
123  virtual inline SGMatrix<float64_t> get_pwm()
124  {
126  }
127 
132  virtual inline SGMatrix<float64_t> get_w()
133  {
135  }
136 
143  virtual SGMatrix<float64_t> get_scoring(int32_t d);
144 
148  void compute_w(int32_t num_pos);
149 
153  void compute_scoring(int32_t max_degree);
154 
156  inline virtual const char* get_name() const { return "PositionalPWM"; }
157 
158  private:
160  void register_params();
161 
162  protected:
163 
165  int32_t m_pwm_rows;
166 
168  int32_t m_pwm_cols;
169 
172 
175 
178 
180  int32_t m_w_rows;
181 
183  int32_t m_w_cols;
184 
187 
189  int32_t m_poim_len;
190 
193 
194 };
195 }
196 #endif //_POSITIONAL_PWM_H__

SHOGUN Machine Learning Toolbox - Documentation