36 "void CRandomFourierGaussPreproc::copy(...): feats.randomcoeff_additive==NULL && cur_dim_feature_space>0 \n");
52 "void CRandomFourierGaussPreproc::copy(...): feats.randomcoeff_multiplicative==NULL && cur_dim_feature_space>0 &&(cur_dim_input_space>0) \n");
152 "void CRandomFourierGaussPreproc::set_dim_feature_space(const int32 dim): dim<=0 is not allowed");
164 if (kernelwidth2 <= 0) {
166 "void CRandomFourierGaussPreproc::set_kernelwidth(const float64_t kernelwidth2 ): kernelwidth2 <= 0 is not allowed");
178 "void CRandomFourierGaussPreproc::set_dim_input_space(const int32 dim): dim<=0 is not allowed");
204 "bool CRandomFourierGaussPreproc::init_randomcoefficients(): dim_feature_space<=0 is not allowed\n");
208 "bool CRandomFourierGaussPreproc::init_randomcoefficients(): dim_input_space<=0 is not allowed\n");
216 SG_INFO(
"initializing randomcoefficients \n")
254 SG_INFO(
"finished: initializing randomcoefficients \n")
261 float64_t ** randomcoeff_multiplicative2, int32_t *dim_feature_space2,
262 int32_t *dim_input_space2,
float64_t* kernelwidth2)
const {
264 ASSERT(randomcoeff_additive2)
265 ASSERT(randomcoeff_multiplicative2)
268 *dim_feature_space2 = 0;
269 *dim_input_space2 = 0;
271 *randomcoeff_additive2 = NULL;
272 *randomcoeff_multiplicative2 = NULL;
284 *randomcoeff_additive2);
286 *randomcoeff_multiplicative2);
294 const int32_t dim_feature_space2,
const int32_t dim_input_space2,
const float64_t kernelwidth2) {
313 std::copy(randomcoeff_additive2, randomcoeff_additive2
315 std::copy(randomcoeff_multiplicative2, randomcoeff_multiplicative2
324 "CRandomFourierGaussPreproc::init (CFeatures *f) requires CDenseFeatures<float64_t> as features\n");
328 "CRandomFourierGaussPreproc::init (CFeatures *f) requires CDenseFeatures<float64_t> as features\n");
332 "CRandomFourierGaussPreproc::init (CFeatures *f): dim_feature_space<=0 is not allowed, use void set_dim_feature_space(const int32 dim) before!\n");
335 SG_INFO(
"calling CRandomFourierGaussPreproc::init(...)\n")
336 int32_t num_features =
357 "float64_t * CRandomFourierGaussPreproc::apply_to_feature_vector(...): test_rfinited()==false: you need to call before CRandomFourierGaussPreproc::init (CFeatures *f) OR 1. set_dim_feature_space(const int32 dim), 2. set_dim_input_space(const int32 dim), 3. init_randomcoefficients() or set_randomcoefficients(...) \n");
377 int32_t num_vectors = 0;
378 int32_t num_features = 0;
380 num_features, num_vectors);
381 SG_INFO(
"get Feature matrix: %ix%i\n", num_vectors, num_features)
386 "float64_t * CRandomFourierGaussPreproc::apply_to_feature_matrix(CFeatures *f): num_features!=cur_dim_input_space is not allowed\n");
395 for (int32_t vec = 0; vec < num_vectors; vec++)
403 cur_dim_input_space));
float64_t * randomcoeff_multiplicative
int32_t cur_dim_input_space
void set_dim_feature_space(const int32_t dim)
Class ShogunException defines an exception which is thrown whenever an error inside of shogun occurs...
int32_t get_dim_input_space() const
int32_t dim_feature_space
virtual SGVector< float64_t > apply_to_feature_vector(SGVector< float64_t > vector)
float64_t * randomcoeff_additive
float64_t cur_kernelwidth
virtual bool init(CFeatures *f)
bool init_randomcoefficients()
EFeatureClass
shogun feature class
~CRandomFourierGaussPreproc()
virtual EFeatureType get_feature_type()
CRandomFourierGaussPreproc()
int32_t cur_dim_feature_space
void set_randomcoefficients(float64_t *randomcoeff_additive2, float64_t *randomcoeff_multiplicative2, const int32_t dim_feature_space2, const int32_t dim_input_space2, const float64_t kernelwidth2)
Template class DensePreprocessor, base class for preprocessors (cf. CPreprocessor) that apply to CDen...
bool test_rfinited() const
void set_kernelwidth(const float64_t width)
float64_t get_kernelwidth() const
int32_t get_dim_feature_space() const
virtual EFeatureClass get_feature_class() const =0
void copy(const CRandomFourierGaussPreproc &feats)
static float64_t dot(const bool *v1, const bool *v2, int32_t n)
Compute dot product between v1 and v2 (blas optimized)
EFeatureType
shogun feature type
virtual EFeatureClass get_feature_class()
void add_vector(bool **param, index_t *length, const char *name, const char *description="")
all of classes and functions are contained in the shogun namespace
The class Features is the base class of all feature objects.
void set_dim_input_space(const int32_t dim)
static float64_t log(float64_t v)
Preprocessor CRandomFourierGaussPreproc implements Random Fourier Features for the Gauss kernel a la ...
static float32_t sqrt(float32_t x)
void add_matrix(bool **param, index_t *length_y, index_t *length_x, const char *name, const char *description="")
void get_randomcoefficients(float64_t **randomcoeff_additive2, float64_t **randomcoeff_multiplicative2, int32_t *dim_feature_space2, int32_t *dim_input_space2, float64_t *kernelwidth2) const
virtual SGMatrix< float64_t > apply_to_feature_matrix(CFeatures *features)
virtual EFeatureType get_feature_type() const =0