33 void CSOSVMHelper::init()
64 for (int32_t i = 0; i < N; i++)
75 hinge_losses += hinge_loss_i;
95 for (int32_t i = 0; i < N; i++)
100 loss += result->
delta;
111 if (m_tracker >= m_bufsize)
113 SG_PRINT(
"%s::add_debug_information(): Buffer overflows! No more values will be recorded!\n",
119 m_primal[m_tracker] = primal;
120 m_eff_pass[m_tracker] = eff_pass;
121 m_train_error[m_tracker] = train_error;
125 m_dual[m_tracker] = dual;
126 m_duality_gap[m_tracker] = dgap;
144 return m_duality_gap;
154 return m_train_error;
Base class of the labels used in Structured Output (SO) problems.
virtual const char * get_name() const
static float64_t primal_objective(SGVector< float64_t > w, CStructuredModel *model, float64_t lbda)
CStructuredLabels * get_labels()
SGVector< float64_t > get_dual_values() const
Class SGObject is the base class of all shogun objects.
static float64_t dual_objective(SGVector< float64_t > w, float64_t aloss, float64_t lbda)
static float64_t dot(const bool *v1, const bool *v2, int32_t n)
Compute dot product between v1 and v2 (blas optimized)
static float64_t average_loss(SGVector< float64_t > w, CStructuredModel *model, bool is_ub=false)
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 add_debug_info(float64_t primal, float64_t eff_pass, float64_t train_error, float64_t dual=-1, float64_t dgap=-1)
virtual int32_t get_num_labels() const
SGVector< float64_t > get_duality_gaps() const
SGVector< float64_t > get_primal_values() const
void resize_vector(int32_t n)
SGVector< float64_t > get_train_errors() const
SGVector< float64_t > get_eff_passes() const