16 using namespace shogun;
44 void COnlineLibLinear::init()
64 SG_ERROR(
"Specified features are not of type CStreamingDotFeatures\n");
113 QD = diag[y_current + 1];
125 C = upper_bound[y_current + 1];
126 G += alpha_current*diag[y_current + 1];
129 if (alpha_current == 0)
139 else if (alpha_current == C)
155 if (fabs(PG) > 1.0e-12)
159 d = (alpha_current - alpha_old) * y_current;
167 v += alpha_current*(alpha_current*diag[y_current + 1] - 2);
168 if (alpha_current > 0)
179 SG_INFO(
"Optimization finished.\n");
182 for (int32_t i=0; i<
w_dim; i++)
186 SG_INFO(
"Objective value = %lf\n", v/2);
Class Time that implements a stopwatch based on either cpu time or wall clock time.
bool has_property(EFeatureProperty p)
Class OnlineLinearMachine is a generic interface for linear machines like classifiers which work thro...
virtual void start_parser()=0
virtual float32_t dense_dot(const float32_t *vec2, int32_t vec2_len)=0
virtual bool train(CFeatures *data=NULL)
static const float64_t INFTY
infinity
virtual float32_t dot(CStreamingDotFeatures *df)=0
virtual void set_features(CStreamingDotFeatures *feat)
void add(bool *param, const char *name, const char *description="")
virtual bool get_next_example()=0
virtual ~COnlineLibLinear()
virtual void expand_if_required(float32_t *&vec, int32_t &len)
static T max(T a, T b)
return the maximum of two integers
Streaming features that support dot products among other operations.
virtual void add_to_dense_vec(float32_t alpha, float32_t *vec2, int32_t vec2_len, bool abs_val=false)=0
virtual void end_parser()=0
CStreamingDotFeatures * features
The class Features is the base class of all feature objects.
static T min(T a, T b)
return the minimum of two integers
virtual void release_example()=0
virtual float64_t get_label()=0