44 random_params(dim, 0) = vec[dim];
50 random_params(dim, sample) = vec[dim];
72 void CRandomKitchenSinksDotFeatures::init(
CDotFeatures* dataset,
93 ASSERT(
typeid(*
this) ==
typeid(*df));
104 tmp_dot_2 = other->
post_dot(tmp_dot_2, i);
105 dot_product += tmp_dot_1 * tmp_dot_2;
111 int32_t vec_idx1,
const float64_t* vec2, int32_t vec2_len)
121 dot_product += tmp_dot * vec2[i];
128 int32_t vec_idx1,
float64_t* vec2, int32_t vec2_len,
bool abs_val)
130 SG_DEBUG(
"Entering add_to_dense()\n");
140 vec2[i] += alpha * tmp_dot;
142 SG_DEBUG(
"Leaving add_to_dense()\n");
185 return "RandomKitchenSinksDotFeatures";
class that implements the Random Kitchen Sinks (RKS) for the DotFeatures as mentioned in http://books...
SGMatrix< float64_t > random_coeff
virtual int32_t get_num_vectors() const
virtual float64_t dense_dot(int32_t vec_idx1, const float64_t *vec2, int32_t vec2_len)=0
virtual bool get_next_feature(int32_t &index, float64_t &value, void *iterator)
virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1, float64_t *vec2, int32_t vec2_len, bool abs_val=false)
virtual int32_t get_num_vectors() const =0
#define SG_NOTIMPLEMENTED
SGMatrix< float64_t > generate_random_coefficients()
SGMatrix< float64_t > get_random_coefficients()
virtual int32_t get_nnz_features_for_vector(int32_t num)
virtual EFeatureClass get_feature_class() const
Features that support dot products among other operations.
EFeatureClass
shogun feature class
virtual int32_t get_dim_feature_space() const =0
virtual float64_t dense_dot(int32_t vec_idx1, const float64_t *vec2, int32_t vec2_len)
const char * get_name() const
virtual int32_t get_dim_feature_space() const
void add(bool *param, const char *name, const char *description="")
Class SGObject is the base class of all shogun objects.
virtual ~CRandomKitchenSinksDotFeatures()
A File access base class.
CRandomKitchenSinksDotFeatures()
T * get_column_vector(index_t col) const
virtual SGVector< float64_t > generate_random_parameter_vector()=0
EFeatureType
shogun feature type
virtual CFeatures * duplicate() const
virtual void free_feature_iterator(void *iterator)
all of classes and functions are contained in the shogun namespace
The class Features is the base class of all feature objects.
virtual float64_t dot(int32_t vec_idx1, CDotFeatures *df, int32_t vec_idx2)
virtual void * get_feature_iterator(int32_t vector_index)
virtual float64_t post_dot(float64_t dot_result, index_t par_idx)
virtual EFeatureType get_feature_type() const