SHOGUN
v2.0.0
|
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) 2012 Viktor Gal 00008 * Copyright (C) 2012 Viktor Gal 00009 */ 00010 00011 #ifndef __LATENTMODEL_H__ 00012 #define __LATENTMODEL_H__ 00013 00014 #include <shogun/labels/LatentLabels.h> 00015 #include <shogun/features/LatentFeatures.h> 00016 #include <shogun/features/DotFeatures.h> 00017 00018 namespace shogun 00019 { 00030 class CLatentModel: public CSGObject 00031 { 00032 public: 00034 CLatentModel(); 00035 00041 CLatentModel(CLatentFeatures* feats, CLatentLabels* labels); 00042 00044 virtual ~CLatentModel(); 00045 00050 virtual int32_t get_num_vectors() const; 00051 00056 virtual int32_t get_dim() const=0; 00057 00062 void set_labels(CLatentLabels* labs); 00063 00068 CLatentLabels* get_labels() const; 00069 00074 void set_features(CLatentFeatures* feats); 00075 00080 virtual CDotFeatures* get_psi_feature_vectors()=0; 00081 00090 virtual CData* infer_latent_variable(const SGVector<float64_t>& w, index_t idx)=0; 00091 00097 virtual void argmax_h(const SGVector<float64_t>& w); 00098 00103 virtual const char* get_name() const { return "LatentModel"; } 00104 00105 protected: 00107 CLatentFeatures* m_features; 00109 CLatentLabels* m_labels; 00110 00111 private: 00113 void register_parameters(); 00114 }; 00115 } 00116 00117 #endif /* __LATENTMODEL_H__ */ 00118