15 using namespace shogun;
43 SG_ERROR(
"LatentModel is not set!\n")
53 ASSERT(latent_model != NULL)
62 SG_ERROR(
"LatentModel is not set!\n")
73 float64_t decrement = 0.0, primal_obj = 0.0, prev_po = 0.0;
84 SG_DEBUG(
"Do the inner loop of CCCP: optimize for w for fixed h*\n")
88 decrement = prev_po - primal_obj;
90 SG_DEBUG(
"decrement: %f\n", decrement)
91 SG_DEBUG(
"primal objective: %f\n", primal_obj)
94 stop = (inner_eps < (0.5*
m_C*m_epsilon+1E-8)) && (decrement <
m_C*
m_epsilon);
96 inner_eps = -decrement*0.01;
98 SG_DEBUG(
"inner epsilon: %f\n", inner_eps)
101 SG_DEBUG(
"Find and set h_i = argmax_h (w, psi(x_i,h))\n")
104 SG_DEBUG(
"Recalculating PSI (x,h) with the new h variables\n")
114 void CLinearLatentMachine::init()
virtual float64_t do_inner_loop(float64_t cooling_eps)=0
Abstract class CLatentModel It represents the application specific model and contains most of the app...
Latent Features class The class if for representing features for latent learning, e...
virtual ~CLinearLatentMachine()
static CLatentFeatures * obtain_from_generic(CFeatures *base_feats)
virtual CLatentLabels * apply_latent()=0
void add(bool *param, const char *name, const char *description="")
Class SGObject is the base class of all shogun objects.
void set_model(CLatentModel *latent_model)
static T max(T a, T b)
return the maximum of two integers
Class LinearMachine is a generic interface for all kinds of linear machines like classifiers.
virtual void argmax_h(const SGVector< float64_t > &w)
The class Features is the base class of all feature objects.
virtual int32_t get_dim() const =0
virtual bool train_machine(CFeatures *data=NULL)
virtual int32_t get_num_vectors() const
void resize_vector(int32_t n)
void set_features(CLatentFeatures *feats)
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.
void cache_psi_features()