21 :
CMachine(), m_model(NULL), m_surrogate_loss(NULL)
23 register_parameters();
29 :
CMachine(), m_model(model), m_surrogate_loss(NULL)
33 register_parameters();
56 void CStructuredOutputMachine::register_parameters()
70 REQUIRE(
m_model != NULL,
"please call set_model() before set_labels()\n");
101 int32_t from=0, to=0;
116 for (int32_t i=0; i<dim; i++)
119 for (int32_t i=from; i<to; i++)
135 SG_ERROR(
"%s::risk_nslack_slack_rescale() has not been implemented!\n",
get_name());
141 SG_ERROR(
"%s::risk_1slack_margin_rescale() has not been implemented!\n",
get_name());
147 SG_ERROR(
"%s::risk_1slack_slack_rescale() has not been implemented!\n",
get_name());
153 SG_ERROR(
"%s::risk_customized_formulation() has not been implemented!\n",
get_name());
190 SG_ERROR(
"%s::get_helper(): no helper has been created!"
191 "Please set verbose before training!\n",
get_name());
SGVector< float64_t > psi_truth
Base class of the labels used in Structured Output (SO) problems.
Class CLossFunction is the base class of all loss functions.
void set_labels(CStructuredLabels *labs)
The class Labels models labels, i.e. class assignments of objects.
CSOSVMHelper * get_helper() const
CLossFunction * m_surrogate_loss
virtual float64_t risk_customized_formulation(float64_t *subgrad, float64_t *W, TMultipleCPinfo *info=0)
virtual int32_t get_num_vectors() const =0
virtual float64_t risk_1slack_slack_rescale(float64_t *subgrad, float64_t *W, TMultipleCPinfo *info=0)
void set_verbose(bool verbose)
CStructuredModel * m_model
virtual int32_t get_dim() const =0
CLossFunction * get_surrogate_loss() const
virtual ~CStructuredOutputMachine()
CFeatures * get_features() const
virtual const char * get_name() const
A generic learning machine interface.
void set_features(CFeatures *feats)
virtual float64_t risk_nslack_margin_rescale(float64_t *subgrad, float64_t *W, TMultipleCPinfo *info=0)
Class SGObject is the base class of all shogun objects.
CStructuredOutputMachine()
void set_features(CFeatures *f)
void set_model(CStructuredModel *model)
class CSOSVMHelper contains helper functions to compute primal objectives, dual objectives, average training losses, duality gaps etc. These values will be recorded to check convergence. This class is inspired by the matlab implementation of the block coordinate Frank-Wolfe SOSVM solver [1].
virtual float64_t risk_nslack_slack_rescale(float64_t *subgrad, float64_t *W, TMultipleCPinfo *info=0)
virtual float64_t risk(float64_t *subgrad, float64_t *W, TMultipleCPinfo *info=0, EStructRiskType rtype=N_SLACK_MARGIN_RESCALING)
static void vec1_plus_scalar_times_vec2(T *vec1, const T scalar, const T *vec2, int32_t n)
x=x+alpha*y
Class CStructuredModel that represents the application specific model and contains most of the applic...
all of classes and functions are contained in the shogun namespace
virtual CResultSet * argmax(SGVector< float64_t > w, int32_t feat_idx, bool const training=true)=0
virtual void set_labels(CLabels *lab)
The class Features is the base class of all feature objects.
SGVector< float64_t > psi_pred
CStructuredModel * get_model() const
static CStructuredLabels * to_structured(CLabels *base_labels)
virtual void set_labels(CLabels *lab)
CFeatures * get_features()
virtual float64_t risk_1slack_margin_rescale(float64_t *subgrad, float64_t *W, TMultipleCPinfo *info=0)
void set_surrogate_loss(CLossFunction *loss)