SHOGUN  v2.0.0
 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/common.h>
17 
18 namespace shogun
19 {
24  {
25 
26  public:
27 
30 
33 
40 
41  virtual ~CLinearLatentMachine();
42 
47  virtual CLatentLabels* apply_latent() = 0;
48 
54  virtual CLatentLabels* apply_latent(CFeatures* data);
55 
60  virtual const char* get_name() const { return "LinearLatentMachine"; }
61 
66  inline void set_epsilon(float64_t eps) { m_epsilon=eps; }
67 
72  inline float64_t get_epsilon() { return m_epsilon; }
73 
78  inline void set_C(float64_t c)
79  {
80  m_C=c;
81  }
82 
87  inline float64_t get_C() { return m_C; }
88 
93  inline void set_max_iterations(int32_t iter) { m_max_iter = iter; }
94 
99  inline int32_t get_max_iterations() { return m_max_iter; }
100 
105  void set_model(CLatentModel* latent_model);
106 
107  protected:
108  virtual bool train_machine(CFeatures* data=NULL);
109 
111  virtual void cache_psi_vectors();
112 
119  virtual float64_t do_inner_loop(float64_t cooling_eps)=0;
120 
121  virtual bool train_require_labels() const { return false; }
122 
123  protected:
131  int32_t m_max_iter;
132 
133  private:
135  void init();
136  };
137 }
138 
139 #endif /* __LATENTLINEARMACHINE_H__ */
140 

SHOGUN Machine Learning Toolbox - Documentation