35 "void CRandomFourierGaussPreproc::copy(...): feats.randomcoeff_additive==NULL && cur_dim_feature_space>0 \n");
51 "void CRandomFourierGaussPreproc::copy(...): feats.randomcoeff_multiplicative==NULL && cur_dim_feature_space>0 &&(cur_dim_input_space>0) \n");
151 "void CRandomFourierGaussPreproc::set_dim_feature_space(const int32 dim): dim<=0 is not allowed");
163 if (kernelwidth2 <= 0) {
165 "void CRandomFourierGaussPreproc::set_kernelwidth(const float64_t kernelwidth2 ): kernelwidth2 <= 0 is not allowed");
177 "void CRandomFourierGaussPreproc::set_dim_input_space(const int32 dim): dim<=0 is not allowed");
203 "bool CRandomFourierGaussPreproc::init_randomcoefficients(): dim_feature_space<=0 is not allowed\n");
207 "bool CRandomFourierGaussPreproc::init_randomcoefficients(): dim_input_space<=0 is not allowed\n");
215 SG_INFO(
"initializing randomcoefficients \n")
253 SG_INFO(
"finished: initializing randomcoefficients \n")
260 float64_t ** randomcoeff_multiplicative2, int32_t *dim_feature_space2,
261 int32_t *dim_input_space2,
float64_t* kernelwidth2)
const {
263 ASSERT(randomcoeff_additive2)
264 ASSERT(randomcoeff_multiplicative2)
267 *dim_feature_space2 = 0;
268 *dim_input_space2 = 0;
270 *randomcoeff_additive2 = NULL;
271 *randomcoeff_multiplicative2 = NULL;
283 *randomcoeff_additive2);
285 *randomcoeff_multiplicative2);
293 const int32_t dim_feature_space2,
const int32_t dim_input_space2,
const float64_t kernelwidth2) {
312 std::copy(randomcoeff_additive2, randomcoeff_additive2
314 std::copy(randomcoeff_multiplicative2, randomcoeff_multiplicative2
323 "CRandomFourierGaussPreproc::init (CFeatures *f) requires CDenseFeatures<float64_t> as features\n");
327 "CRandomFourierGaussPreproc::init (CFeatures *f) requires CDenseFeatures<float64_t> as features\n");
331 "CRandomFourierGaussPreproc::init (CFeatures *f): dim_feature_space<=0 is not allowed, use void set_dim_feature_space(const int32 dim) before!\n");
334 SG_INFO(
"calling CRandomFourierGaussPreproc::init(...)\n")
335 int32_t num_features =
356 "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");
376 int32_t num_vectors = 0;
377 int32_t num_features = 0;
379 num_features, num_vectors);
380 SG_INFO(
"get Feature matrix: %ix%i\n", num_vectors, num_features)
385 "float64_t * CRandomFourierGaussPreproc::apply_to_feature_matrix(CFeatures *f): num_features!=cur_dim_input_space is not allowed\n");
394 for (int32_t vec = 0; vec < num_vectors; vec++)
402 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)
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)
x^0.5
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
static T abs(T a)
return the absolute value of a number