21 CLatentSVM::CLatentSVM()
31 CLatentSVM::~CLatentSVM()
38 SG_ERROR(
"LatentModel is not set!\n")
50 for (
index_t i = 0; i < num_examples; ++i)
53 CData* h = m_model->infer_latent_variable(w, i);
54 hs->add_latent_label(h);
59 x->
dense_dot_range(ys->get_labels().vector, 0, num_examples, NULL, w.vector, w.vlen, 0.0);
66 CLabels* ys = m_model->get_labels()->get_labels();
68 m_model->get_cached_psi_features() :
69 m_model->get_psi_feature_vectors());
70 CSVMOcas svm(m_C, feats, ys);
71 svm.set_epsilon(cooling_eps);
77 set_w(svm.get_w().clone());
79 return svm.compute_primal_objective();
82 #endif //USE_GPL_SHOGUN Abstract class CLatentModel It represents the application specific model and contains most of the app...
virtual void dense_dot_range(float64_t *output, int32_t start, int32_t stop, float64_t *alphas, float64_t *vec, int32_t dim, float64_t b)
The class Labels models labels, i.e. class assignments of objects.
Features that support dot products among other operations.
void set_labels(CLatentLabels *labs)
all of classes and functions are contained in the shogun namespace
abstract implementaion of Linear Machine with latent variable This is the base implementation of all ...
Binary Labels for binary classification.
abstract class for latent labels As latent labels always depends on the given application, this class only defines the API that the user has to implement for latent labels.
virtual int32_t get_num_vectors() const