SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LinearLatentMachine.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) 2012 Viktor Gal
8  * Copyright (C) 2012 Viktor Gal
9  */
10 
11 #ifndef __LATENTLINEARMACHINE_H__
12 #define __LATENTLINEARMACHINE_H__
13 
14 #include <shogun/lib/config.h>
15 
16 #include <shogun/lib/common.h>
18 
19 namespace shogun
20 {
21  class CFeatures;
22  class CLatentLabels;
23  class CLatentModel;
24 
29  {
30 
31  public:
32 
35 
38 
45 
46  virtual ~CLinearLatentMachine();
47 
52  virtual CLatentLabels* apply_latent() = 0;
53 
59  virtual CLatentLabels* apply_latent(CFeatures* data);
60 
65  virtual const char* get_name() const { return "LinearLatentMachine"; }
66 
71  inline void set_epsilon(float64_t eps) { m_epsilon=eps; }
72 
77  inline float64_t get_epsilon() { return m_epsilon; }
78 
83  inline void set_C(float64_t c)
84  {
85  m_C=c;
86  }
87 
92  inline float64_t get_C() { return m_C; }
93 
98  inline void set_max_iterations(int32_t iter) { m_max_iter = iter; }
99 
104  inline int32_t get_max_iterations() { return m_max_iter; }
105 
110  void set_model(CLatentModel* latent_model);
111 
112  protected:
113  virtual bool train_machine(CFeatures* data=NULL);
114 
121  virtual float64_t do_inner_loop(float64_t cooling_eps)=0;
122 
123  virtual bool train_require_labels() const { return false; }
124 
125  protected:
133  int32_t m_max_iter;
135  int32_t m_cur_iter;
136 
137  private:
139  void init();
140  };
141 }
142 
143 #endif /* __LATENTLINEARMACHINE_H__ */

SHOGUN Machine Learning Toolbox - Documentation